生活随笔
收集整理的這篇文章主要介紹了
c语言常考
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. BOOL和bool區別
2.?談談對回調函數的理解??
3. 在。。。編碼中漢字占幾個字節
?如何用c語言編程求對數:如:log(2)16 (括號中數為底數)
??? 使用換底公式:log(a)b=log(s)b/log(s)a
???
#include?<math.h> ?#include?<stdio.h> ??int?main(void) ?{ ?????double?result; ?????double?x=16; ????? ?????result=log(16)/log(2); ?????printf("result?is?%lf\n",result); ?}? ?結構體相關
#include?<stdio.h> ?#include?<stdlib.h> ?struct?ss ?{ ?????int?aa; ?????int?bb; ?}; ?int?main(void) ?{ ?????int?i[]={9,8,7,6,5,4,3,2,1,0}; ?????struct?ss?*p1=(struct?ss*)i; ?????struct?ss?*p2=p1+4;?????printf("%d?%d\n",p2->aa,p2->bb);??}? ?填充函數,使輸出為:ood
#include?<stdio.h>?#include?<stdlib.h>??void?move(__A__) ?{ ?????______B______ ?} ??int?main(void) ?{ ?????char?*str="good"; ?????move(__C__); ?????printf("%s\n",str);??//使輸出為:ood ?????return?0; ?}? ??? 答案:考察傳值與傳址。str其實也是個變量,若要改變它的指向,則要改變它的值,所以實參需傳入它的地址。
#include?<stdio.h> ?#include?<stdlib.h> ??void?move(char?**s) ?{ ?????*s+=1; ?} ??int?main(void) ?{ ?????char?*str="good"; ?????move(&str); ?????printf("%s\n",str); ??????return?0; ?}? ?
轉載于:https://blog.51cto.com/liangbing8612/669732
總結
以上是生活随笔為你收集整理的c语言常考的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。