I have an array which might contain empty/null positions (e.g: array[2]=3, array[4]=empty/unassigned). I want to check in a loop whether the array position is null.
array[4]==NULL //this doesn't work I'm pretty new to C++.
Thanks.
Edit: Here's more code; A header file contains the following declaration
int y[50]; The population of the array is done in another class,
geoGraph.y[x] = nums[x]; The array should be checked for null in the following code;
int x=0; for(int i=0; i<sizeof(y);i++){ //check for null p[i].SetPoint(Recto.Height()-x,y[i]); if(i>0){ dc.MoveTo(p[i-1]); dc.LineTo(p[i]); } x+=50; }
NULLand0are both null pointer literals, but they might not be the same type.