คืออาจารเค้าให้ลองเขียนตามหนังสือเรียนแล้วบอกผลที่ได้ครับ แต่มันยังรันไม่ได้เลย ช่วยผมหน่อยนะครับ
#include <iostream>
#include <string.h>
struct address
{
char district [31];
char provine[31];
char postcode[6];
};
struct company
{char name [51];
struct address sub;
int age;
char gender;
}
employee[5];
main()
{
strcpy(employee[4].name,"Miss.Manee Jun");
employee[4].age=20;
employee[4].gender='f';
strcpy(employee[4].sub.district,"Dusit");
strcpy(employee[4].sub.province,"Bangkok");
strcpy(employee[4].sub.postcode,"10300");
cout<<employee [4].name,
employee [4].sub.district,
employee [4].sub.prostcode,
employee [4].sub.postcode,
employee [4].age;
employee [4].gender;
}
โค้ด ภาษาซีผมมันรันไม่ได้ครับบช่วยผมหน่อย T^T
#include <iostream>
#include <string.h>
struct address
{
char district [31];
char provine[31];
char postcode[6];
};
struct company
{char name [51];
struct address sub;
int age;
char gender;
}
employee[5];
main()
{
strcpy(employee[4].name,"Miss.Manee Jun");
employee[4].age=20;
employee[4].gender='f';
strcpy(employee[4].sub.district,"Dusit");
strcpy(employee[4].sub.province,"Bangkok");
strcpy(employee[4].sub.postcode,"10300");
cout<<employee [4].name,
employee [4].sub.district,
employee [4].sub.prostcode,
employee [4].sub.postcode,
employee [4].age;
employee [4].gender;
}