内功题
试题1:分别给出BOOL,int,float,指针变
量与"零值"比较的if 语句(假设变量名为var)
用C 写一个输入的整数,倒着输出整数的函数,
要求用递归方法;
试题4:
void GetMemory(char *p )
{
p = (char *) malloc(100 );
}
void Test(void )
{
char *str = NULL;
GetMemory(str );
strcpy(str, "hello world" );
printf(str );
}
下面的代码有什么问题?
class A
{
public:
A() { p=this; }
~A() { if(p!=NULL) { delete p; p=NULL; } }
A* p;
};