hi all,
I am trying to create a pointer to a member of a struct and then do a boolean comparison to see if there is currently anything in that member.
here is what I have so far:
card* openPtr = opencells;
char* rankPtr;
rankPtr = (*openPtr).rank;
cout<<" Free Cells "<<endl;
cout<<"1 2 3 4" << endl;
cout << endl;
for (int i=0; i<NUM_FREE_CELLS; i++)
{
if (*rankPtr !='\0')
{
print_card(rankPtr);
{
if (*rankPtr=='0')
cout<<" ";
else
if (*rankPtr > 13)
cout<<" ";
} openPtr++;
}
else
cout<<" ";
cout<<endl;
}
the struct is type card, and opencells is an array of type card that has been passed to the function. I'm getting an error when attempting to compare *rankPtr to a value.
Thanks for any insight