當前位置:編程學習大全網 - 網站源碼 - 嵌入式Linux中關於c面試題?

嵌入式Linux中關於c面試題?

2.某32位系統下, C++程序,請計算sizeof 的值(5分).char str[] = “ /”char *p = str ;int n = 10;請計算sizeof (str ) = ?(1)sizeof ( p ) = ?(2)sizeof ( n ) = ?(3)void Foo ( char str[100]){請計算sizeof( str ) = ?(4)}void *p = malloc( 100 );請計算sizeof ( p ) = ?(5)2>Void GetMemory(char **p, int num){*p = (char *)malloc(num);}void Test(void){char *str = NULL;GetMemory(&str, 100);strcpy(str, "hello");printf(str);}請問運行Test 函數會有什麽樣的結果?3>int i=10, j=10, k=3; k*=i+j; k最後的值是4>以下是求壹個數的平方的程序,請找出錯誤:  #define SQUARE(a)((a)*(a))  int a=5;  int b;  b=SQUARE(a++);4>C/C++編譯器中虛表是如何完成的?5>.對於壹個頻繁使用的短小函數,在C語言中應用什麽實現,在C++中應用什麽實現?6>unsigned char *p1; unsigned long *p2; p1=(unsigned char *)0x801000; p2=(unsigned long *)0x810000; 請問p1+5= ; p2+5= ;

  • 上一篇:配置java環境變量的作用是什麽?
  • 下一篇:區間重合度指標公式
  • copyright 2024編程學習大全網