>In any statement, do not change a value within the statement if that value is referenced more than once in the statement. The processing/result of the statement is undefined, therefore it doesn't...
Type: Posts; User: pizzas
>In any statement, do not change a value within the statement if that value is referenced more than once in the statement. The processing/result of the statement is undefined, therefore it doesn't...
>It should not matter. As long as you don't change the values while printing, right or left will give you the same answer.
Yeah, it should not matter only if i don't change the values ( like...
I don't know if i understand it not.. ( but for some reson i think i did..)
The link you posted, Salem, previously, says only about ++ and not about +=. But ok.
I tried your piece of code, and...
Hey, Prelude, you said fflush(stdout);
What that means/does ?
Also in your if statement, the return value of scanf is 2?
Thx - Polor
I am afraid that noone ( ecxept WaltP i think ) has understood the problem.
---------->>
I know that i add 1 to p and that the new value is not known in advance, it is "random". I know that it...
Is that the only thing you have to say, for all of my above questions????
>printf("%d %d %d %d",p,++p,p++,++p);
i understand why it is undefined, but i don't use x++ and ++x, I use x+=1.
Hey...
Well, your example says about x++ and ++x, not about x+=1. x+=1 doesn't have the same problem as with ++, as my teacher tells me, so why to have this problem with my code?
>But that is only in...
I know that anything might happen to the values, but the problem is the way it prints the values. My tutor didn't told us this example. He told us that if you write somewhere p+=1, *p might get any...
We just got in pointers in my class, and i am facing some difficulties in understanding them.
Here's the code with the problem:
#include <stdio.h>
main()
{
int *p;
Ok, thanks! I got it now! :)
- Polor
ok, but what about my other 2 questions?
and what does zero-length string mean?
Thx - Polor
Why this code doesn't work?
<code>
char string[10];
strcat( string, "hello" );
puts ( string );
</code>
and why when i write
<code>