M
mishra
Hi,
i thied the following code..
# include<stdio.h>
int main()
{
int a;
printf("Hello...");
a=fork();
printf("hi\n");
return(0);
}
the o/p is as follows..
rapti:~/prg [\>] > ./a.out
Hello... hi
Hello... hi
but when i gave
# include<stdio.h>
int main()
{
int a;
printf("Hello...\n"); // mark the \n here
a=fork();
printf("hi\n");
return(0);
}
the o/p became ..
rapti:~/prg [\>] > ./a.out
Hello...
hi
hi
can any one tell me how that \n is affecting?
and insted of the printf statement if i put some thing else.. that is
not getting evaluated two times...
please help me out...
regard
Mishra
i thied the following code..
# include<stdio.h>
int main()
{
int a;
printf("Hello...");
a=fork();
printf("hi\n");
return(0);
}
the o/p is as follows..
rapti:~/prg [\>] > ./a.out
Hello... hi
Hello... hi
but when i gave
# include<stdio.h>
int main()
{
int a;
printf("Hello...\n"); // mark the \n here
a=fork();
printf("hi\n");
return(0);
}
the o/p became ..
rapti:~/prg [\>] > ./a.out
Hello...
hi
hi
can any one tell me how that \n is affecting?
and insted of the printf statement if i put some thing else.. that is
not getting evaluated two times...
please help me out...
regard
Mishra