How can char* be a condition in for loop?
- by Jackie
In a book I am reading there is a piece of code :
string x;
size_t h=0;
for(const char* s=x.ctr();*s;++s)
h=(h*17)^*s;
Regarding this code, I have two questions:
how can *s be a condition? what does it mean?
what does "h=(h*17)^*s" mean?
Thanks for help!