更新时间:2018-11-22 15:22作者:才子老师
9.哪种结构平均来讲获取一个值最快?
A. binary tree
B. hash table
C. stack
10.
#include
“stdafx.h”
#include
struct bit
{ int a:3;
int b:2;
int c:3;
};
int main(int argc, char* argv[])
{
bit s;
char *c = (char*)&s;
*c = 0x99;
cout <<
s.a < return 0;
}
Output:?
11.
挑bug,在linux下运行:
#include
char
*reverse(char* str)
{
int len=0, i=0;
char *pstr=str, *ptemp,*pd;
while(*++pstr)
len++;
pstr--;
//ptemp=(char*)malloc(len+1);
ptemp=(char*)malloc(len+1);
pd=ptemp;
while(len--){
*ptemp=*pstr;
ptemp++;
pstr--;
i++;
}
*ptemp=*pstr;
ptemp++;
*ptemp=‘\0’;
return pd;
}
main()
{
char string[40]= “Hello World!”;
char *pstr=string;