Introduction
hey all, I'm matt. I'm new to this forum and C. I hope to stick around and eventually be able to ANSWER questions instead of sit around being new to this.
but for now, new to this is what I am.
My Background
I've been learning from Dave Mark's "Learn C on a Macintosh" I have basic knowledge of java and full knowledge of JavaScript. My home turf is max/msp.
The Confusing Example
Everything was going fine until I hit this one function in the examples. now I'm completely confused.
void ReadLine( char *line ) // line is a string
{
while ( (*line = getchar() ) != '\n' )
line++;
*line = 0;
}
The Questions
Can someone tell me, step by step what this code does???
It's so compact that I really just don't understand it.
How does getchar know which char to get?
How can you assign and compare in the same expression?
Why increment a char?
all these questions and more, answered when you stay tuned to
"When Geeks Pull Out Their Remaining Hair"
after these messages....
-matt