-- 作者:maimarco -- 發佈時間:2004-11-10 19:51:01 -- 錯了嗎?不明白!!!! // sd.cpp : Defines the entry point for the console application. // #include "stdafx.h" struct classd int main(int argc, char* argv[]) |
-- 作者:nearwate -- 發佈時間:2004-11-10 21:23:59 -- 因爲classd不是系統默認的數據類型, 所以不能像普通char類型那樣用=賦值, 只能用strcpy函數, class1.name=bb; 應改爲: strcpy(class1.name,bb); 但要在程序頭加上一個頭文件 #include <string.h> |