#What does the condition is this foor loop mean

14 messages · Page 1 of 1 (latest)

twilit glacier
#

for (const char* p = key; *p; p++) {

solemn pebbleBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For more information use !howto ask.

hexed lantern
#

It means read the value pointed to by p

#

chars are just numbers

twilit glacier
#

yeah but when does the for loop stop?

#

when *p is null or what?

hexed lantern
#

*p can't be null, null only makes sense in the context of pointers

#

0 is false, non-zero values are true

twilit glacier
#

ahhhhhhhh

#

thanks^^

#

!solved

solemn pebbleBOT
#

[SOLVED] What does the condition is this foor loop mean

hexed lantern
#

happy to help, let us know if you have any more questions 🙂

solemn pebbleBOT
#

What does the condition is this foor loop mean