S
Sweety
hello,
can any one tell why
void main()
{
for(;0
printf("hello") ;
}
o/p results 'hello'?
can any one tell why
void main()
{
for(;0
printf("hello") ;
}
o/p results 'hello'?
hello,
can any one tell why
void main()
{
for(;0
printf("hello") ;
}
o/p results 'hello'?
Something said:hello,
can any one tell why
void main()
{
for(;0
printf("hello") ;
}
o/p results 'hello'?
hello,
can any one tell why
void main()
{
for(;0
printf("hello") ;
}
o/p results 'hello'?
... it is semantically equivallent to
#include <stdio.h>
int main (void)
{
/* do nothing */
do
{
printf ("hello\n");
/* do nothing else */
}
while(0);
return 0;
}
Emmanuel Delahaye said:Considering your code fixed and commented ...
#include <stdio.h>
int main (void)
{
for(/* do nothing */;0 ;/* do nothing else */)
{
printf ("hello\n");
}
return 0;
}
... it is semantically equivallent to
#include <stdio.h>
int main (void)
{
/* do nothing */
do
{
printf ("hello\n");
/* do nothing else */
}
while(0);
return 0;
}
... hence the printf() is executed once.
Sweety said:hello !!!
i m not novice on the regard while i have to face erxperts on groups.
hello !!!
i m not novice on the regard while i have to face erxperts on groups.
This code really have strange behaviour plz go thru why it happens
in TC++ 3.0 compiler.
bye,
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.