- P(gun)]
ҕУйPԇ}
ҕУйPԇ}
1, 10,10,4,4Ă(g)(sh)֣24c(din)Ӌ(j)?
(10*10-4)/4=24
2ı_(d)ʽ32C(j)gh(hun)ăr(ji)ֵ()
a{}b;c{˽ˣinti#pragma(4);j;k;char[64];L(zhng)char*p#pragmapack()};d{˽ˣinti#pragma(1);?;k;̿[64L(zhng);char*p#pragmapack()};Ҫ(o(w)Ч){printf(“%d\n”sizeof(a));printf(“%d\n”С(b)l);printf(“%d\n”С(c)l);printf(“%d\n”sizeof(d));0;}1,4,84824,4,82,84bc4,4,84,82?1,4,82,82
3ij\(yn)32λC(j)ϵĽY(ji)()
#pragma(4)structinfo_t{o(w)̖(ho)ַ汾;o(w)̖(ho)ַ;o(w)̖(ho)ַ͔U(ku)չ;o(w)̖(ho)ַ(sh);o(w)̖(ho)ַ(bio)ӛ;o(w)̖(ho)ַЧd;o(w)̖(ho)Ķ;unsignedintĕr(sh)g;unsignedintssrc;};(hu)info_u{o(w)̖(ho)ַ汾;o(w)̖(ho)ַ;o(w)̖(ho)ַ͔U(ku)չ;o(w)̖(ho)ַ(sh);o(w)̖(ho)ַ(bio)ӛ;o(w)̖(ho)ַЧd;o(w)̖(ho)Ķ;unsignedintĕr(sh)g;unsignedintssrc;};#pragma()intҪ(o(w)Ч){printf(“%d\n”sizeof(info_t));printf(“%d\n”sizeof(info_u));0;}a12b124c16d1612e161
4б_(d)ʽĽY(ji)ֵ()
#xval1(ab)a*b#xֵ2()a/b--#xval3(ab)+a%binta=1;intb=2c=3;d=3;e=5;Y(ji)=val2(ab)/val1(eb)+val3(cd)-2bcd20
5Ո(qng)³ݔ(5)
o(w)Чswap_1(intaintb){cc=a;a=b;b=cĻ؈(bo);}swap_2(int&a&b){c;c=aa=bb=c;؈(bo);}o(w)Чswap_3(**b){cc=*a*a=*b*b=c;؈(bo);}Ҫ(o(w)Ч){a=100;intb=200;swap_1(ab);printf(“=%db=%d\n”һ);swap_2(ab);printf(“=%db=%d\n”һ);swap_3(&b);printf(“=%2b=%2\n”ab)0;}ݔ
=100b=200
=200b=100
=100b=200
6ijǷІ(wn)}І(wn)}Ո(qng)ؘ(gu)a(5)
o(w)Чtest_type(bconstchar*pֹf)t(p)t(f)£
o(w)Чtest_type(bconstchar*pֹf)t(p)t(f-1e-10f<1e-10)7Ո(qng)עijκɆ(wn)(5)
ğo(w)Чtest_mem(){ַ*p=µchar[64];p(zh)p=null;؈(bo);}(yng)Ąh[]p;pַָ(sh)MĿgԭ(li)ĴaHHጷŵָָg(yng)úͿg(yng)Û](mi)ጷ܌(do)(ni)p
Նһ(g)µČ(du)(ni)gͬr(sh)h֏(f)µ[]һM(du)ă(ni)g(dng)ʹ[]
8ijκɆ(wn)Ո(qng)ע
ַ*getmem(sh)()o(w)Чtest_get_mem(){ַ*p=getmem(sh)();printf(p);;}getmem(sh)ܵpһ(g)ֲ׃ڶїϕr(sh)(sh)\(yn)їă(ni)ݕ(hu)Ԅ(dng)ጷֵ@ܕ(hu)ɞһ(g)I(lng)ָ(do)(hu)һ(g)벻ĽY(ji)
9Ո(qng)strcpyĺmemcpyą^(q)e(5)
strcpymemcpyǘ(bio)(zhn)c(k)(sh)c(din)
strcpyĸṩַHstrcpyַؐ(f)ַHǃ(ni)ݣҲ(f)ַY(ji)
strcpy(sh)ԭǣchar*strcpy(ַ*destУconstchar*src)
memcpyṩһă(ni)(f)Ҫ(f)Ƶmemcpyă(ni)ݛ](mi)˶Ŷˇ
memcpy(sh)ԭ͞飺o(w)Чmemcpy(void*destУo(w)Ч*srcsize_tӋ(j)(sh));
strcpymemcpyҪF(xin)(g)ą^(q)e
1(f)Ƶă(ni)Dzͬstrcpyֻ(f)ַmemcpyĿɏ(f)κ(ni)ݣһ(g)ַ(sh)M(sh)Y(ji)(gu)ȵ
2Բͬķʽ(f)ƵstrcpyIJҪָL(zhng)ȣ˱(f)ƵһַY(ji)ַ“\0”ֱmemcpyĻA(ch)ǰ(g)(sh)Q˸L(zhng)ȡ
3ڲͬĿġͨ(f)ַstrcpy͵Ĕ(sh)(j)Ҫ(f)ƕr(sh)һʹõmemcpy
10Ո(qng)гݔ
A(j)A(ch){A(ch)(){printf(“Ո(qng)ҵĻ()\n”);}̓MA(ch)(){printf(“?()\n”);}̓Mo(w)Чsayhello(){printf(“û\n”);}ğo(w)Чsayworld(){printf(“\”);}};A(ch){(){printf(“ҁ(li)()\n“);}̓M(){printf(”?()\n“);}o(w)Чsayhello();ğo(w)Чsayworld();};o(w)Ч::صsayhello(){printf(“\n”);}o(w)Ч::sayworld(){printf(“\n”);}Ҫ(o(w)Ч){*b1=»;*b2=µ*d=µ;b1->sayhello();b1->sayworld();b2->sayhello();b2->sayworld();d->sayhello();d->sayworld()hdhb2b1h;=null;b2=;b1=null;0;}ݔ
ǻ()
ǻ()
()
()
()
к
A(ch)
?()
?()
ҵ?()
?()
ǻ()
11xIJEoY(ji)
bclass{bclass(intij)int(l)Ȥ̓M();һlclass??bclass{lclass(intijk)bclass(ij)(l)Ȥ()˽ˣz;};Ҫ(o(w)Ч){lclassobj(2,4,10);bclassp1=obj;cout<<<<<< <
12Μplķ(ni)(mallocnew)(do)(ni)Ƭ?(10)
ҕУйPԇ}P(gun)£
ͰУйPԇ}ԇ}08-10
d2016УйPԇ}08-16
2016yдУйPԇ}Ŀ07-26
оԇ}ԇijʡоԇ}07-31
Ѹ2011.10.21Pԇ}08-10
d2015Pԇ}08-02
Ϸ(bo)I(y)PPԇ08-10
Ƹԇ}ʽ08-05
оԇоԇ(jng)ԇԇ}08-09
RP ӛmУԇ08-08