結構體是可以相互賦值的

2021-06-16 23:23:19 字數 431 閱讀 8159

#include

#include

#include

using namespace std;

int main()

//定義乙個操作員的結構體

struct operater

;operater ope1;

operater ope2;

/*cout<<"請輸入操作員的資訊">ope1.id;

cout<<"請輸入操作員的名字">ope1.szname;

cout<<"請輸入操作員的性別">ope1.sz***;

*/ope1.id=1;

ope1.szname="曉明";

ope1.sz***="男";

ope2=ope1; 

coutcin.get();

return 0; 

c語言結構體可以直接賦值

from 下面是乙個例項 include struct foo foo1,foo2 define two structs with three different fields void struct assign void int main 我在ubuntu 13.04下使用gcc 4.7.3 編...

c語言結構體可以直接賦值

下面是乙個例項 include struct foo foo1,foo2 define two structs with three different fields void struct assign void int main 我在ubuntu 13.04下使用gcc 4.7.3 編譯執行得到...

結構體賦值是覆蓋的問題

include stdio.h include stdlib.h include string.h include conio.h typedef struct uploaduserinfo upload element char s nation 3 gg char s address 70 dd...