Hello guys,
I recently started learning to program in C++ and I have hard time understanding my teacher's code. So I understand a big part of the code but what I don't understand is the content of the lines 11 to 13. I'm familiar with the loops etc. but I can't understand the point of the both While loops.
And another thing I want to ask is : what if(*adr) means ? Any help would be appreciated ;)
Lines 11 to 13 deal with a pointer (adr) that points to the character array sub. Also another pointer (next) points to the character array str.
The "while" loop that starts on line 12 is going through each character in each array and comparing them.
Line 20 is a very common comparison that is explained by your teacher's comment. It says
if the character that adr is pointing to is NOT NULL, then output the word "No".