Hello again.
So im trying to compile a programm and i get the following message
"ISO c++ forbids comparisson between pointers and integers"
my code were the problem occurs is the following :
i cant find why it is not working, since the pointer is pointing to an int array.Code:void find() { int num; printf("\n Parakalo doste enan akaireo arithmo : "); //give an integer scanf("%d",&num); for ( int i=0; i<6 ; i++) /*searches an array of 5 inetgers to find if the user's integer is inside the array*/ { if (ptrF==num) /*note: ptfF is a pointer. it is int *ptrF=A...A is the array*/ { printf("\n I timi yparxei ston pinaka sas !"); } if ( ptrF!=num) //change the pointer to +1 to check the next one { ptrF++; } } }
Isnt it pointing to the first elemen of the array??
and when i say ptrF it should go to the next one right??



LinkBack URL
About LinkBacks




