1. BOOL和bool区别

2. 谈谈对回调函数的理解  

3. 在。。。编码中汉字占几个字节

 如何用c语言编程求对数:如:log(2)16 (括号中数为底数)
    使用换底公式:log(a)b=log(s)b/log(s)a
   

  1. #include <math.h>  
  2. #include <stdio.h>  
  3.  
  4. int main(void)  
  5. {  
  6.     double result;  
  7.     double x=16;  
  8.       
  9.     result=log(16)/log(2);  
  10.     printf("result is %lf\n",result);  

 结构体相关

  1. #include <stdio.h>  
  2. #include <stdlib.h>  
  3. struct ss  
  4. {  
  5.     int aa;  
  6.     int bb;  
  7. };  
  8. int main(void)  
  9. {  
  10.     int i[]={9,8,7,6,5,4,3,2,1,0};  
  11.     struct ss *p1=(struct ss*)i;  
  12.     struct ss *p2=p1+4;//pp每加1,相当于加了sizeof(ss)个字节  
  13.     printf("%d %d\n",p2->aa,p2->bb); //1 0  

 填充函数,使输出为:ood

  1. #include <stdio.h> 
  2. #include <stdlib.h> 
  3.  
  4. void move(__A__)  
  5. {  
  6.     ______B______  
  7. }  
  8.  
  9. int main(void)  
  10. {  
  11.     char *str="good";  
  12.     move(__C__);  
  13.     printf("%s\n",str);  //使输出为:ood  
  14.     return 0;  

    答案:考察传值与传址。str其实也是个变量,若要改变它的指向,则要改变它的值,所以实参需传入它的地址。

  1. #include <stdio.h>  
  2. #include <stdlib.h>  
  3.  
  4. void move(char **s)  
  5. {  
  6.     *s+=1;  
  7. }  
  8.  
  9. int main(void)  
  10. {  
  11.     char *str="good";  
  12.     move(&str);  
  13.     printf("%s\n",str);  
  14.  
  15.     return 0;