What does the following mean - it was in our sample solutions
I've never come accross it - and forgive me if its far to basic a question to be asking.Code:while(|-->0) { .... }
What does the following mean - it was in our sample solutions
I've never come accross it - and forgive me if its far to basic a question to be asking.Code:while(|-->0) { .... }
Stick it in a compiler and try it out - should be faster than waiting for someone
to give you an answer.
No No's:
fflush (stdin); gets (); void main ();
Goodies:
Example of fgets (); The FAQ, C/C++ Reference
My Gear:
OS - Windows XP
IDE - MS Visual C++ 2008 Express Edition
ASCII stupid question, get a stupid ANSI
>while(|-->0)
My guess is that's a syntax error and would not compile. It probably should be:
Which is the same as:Code:while(l-->0)
Or:Code:while( (l--) > 0)
Code:while( some_variable--) > 0)
It's not a syntax error. It's 2 separate operators. decrement followed by greater-than.
The parentheses to separate the operations are also unnecessary.
If you understand what you're doing, you're not learning anything.
yuck @ (l-->0), sometimes white spaces really help.
signature under construction
>It's not a syntax error. It's 2 separate operators. decrement followed by greater-than.
In function `main':
parse error before '|' token
Ahh, sorry. I thought the | was an l. Way to go lame-ass fonts
If you understand what you're doing, you're not learning anything.
I had to throw it into another editor, because I wasn't sure what it was. If that was indeed in their sample solutions, then somebody goofed.
No its my bad - i misread it as a '|' instead of an 'l' . Weird thing is theres no l defined anywhere?
not even a
...oh well.Code:int l-->0
edit: - Problem fixed
The code states the following :
Its code like this that makes me turn to C programming board! I would normally use a for loop and loop nLength times - but here the instructor starts with nLength and sets it to decrement till 0.Code://adds number of spaces. void(char ch, int nlength) { while(nLength-->0) putchar(ch); }
Also theres another loop where he passed an l to the function - i missed it.
Last edited by trickae2; 08-25-2006 at 08:41 PM.