C++判断指针是否为空
在函数里使用的时候
if(b)
{
...
}
正常情况下,在我没有new一个新实例之前,这段if是应该不跑的,但是我目前发现b=0Xcdcdcdcdcd,那段if代码还是会执行,那么我该怎么样才能让它真正能判断是否为空呢?
相关推荐
CPP实现的回文判断
回文 C++ void initstack(seqstack *s) { s->top=-1; } int isempty(seqstack *s) { return(s->top==-1?TRUE:FALSE); } void push(seqstack *s,char x) { if(s->top==stacksize-1) {printf("达到输入上限!\n");return;} s->top++; s->elem[s->top]=x; } void pop(seqstack *s,char *x) { if(s->top==-1) {printf("请先输入字符!\n");return;} *x=s->elem[s->top]; s->top--; }
cpp代码-顺序队的算法
cpp代码-顺序队的算法
cpp代码-栈的静态实现
cpp代码-栈的静态实现
顺序栈 C++
完整的顺序栈C++代码 可判空 判满 溢出处理 得到栈顶元素等功能
afxtls.cpp.txt
/ This is a part of the Microsoft Foundation Classes C++ library. // Copyright (C) Microsoft Corporation // All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product.


