-
在 C 語言中,char 型數據在內存中的存儲形式是()。
答:ask2碼 -
#define SIZE_20M (2010241024)
void func_a()
{
char *temp = malloc(SIZE_20M)
return;
}
void func_b()
{
char temp[SIZE_20M];
//…do something using temp
return;
}
答 : func_b 使用了太多的棧,程序可能會在運行時候崩潰。 -
void test(void *data) {
unsigned int value = (此處應填入)
printf("%u", value);
}
using namespace std;
int main() {
unsigned int value = 10;
test(&value);
return 0;
}
答 : *((unsigned int *)data) ; -
c語言中,設有如下說明:
typedef struct ST{
long a; int b; char c[2];
} NEW;
ST爲結構體類型 NEM是一個結構體變量
- 函數參數的默認值不允許爲( )。
答 : 局部變量。 - 統計一個數裏面1的個數
n&(n-1)
while(x)
{
if(x%2 == 1)
{
num ++;
}
x=x/2;
}