看板 Programming 關於我們 聯絡資訊
請教一下,為何 person1.name2="Mary"; 會有問題呢? 謝謝 附上原始程式碼: #include <iostream> using namespace std; main( ) { struct company //結構 { char name2[20]; int salary; int prize; int total; }; struct company person1; person1.name2="Mary"; person1.salary=20000; person1.prize=1500; person1.total=person1.salary + person1.prize; cout << "姓名:" << person1.name2 <<endl; cout << "薪資:" << person1.salary<<endl; cout << "獎金:" << person1.prize<<endl; cout << "總共:" << person1.total<<endl; // system("PAUSE"); return 0; } -- ┌─────KKCITY─────┐ KKBOX 可立刻 聽音樂 ■ bbs.kkcity.com.tw ■■所有想找的歌通通不必等 ■■ └──From:218.169.114.253 ──┘ http://www.kkbox.com.tw --
revivalworld:int main() 60.244.26.68 04/22 19:54