how many times "welcome to the world" message will print ?">
what would be the output of the following program ?main (){printf ("welcome to the world");fork();}how many times "welcome to the world" message will print ?
The fork() system call will spawn a new child process which is an identical process to the parent except that has a new system process ID. Hence printf ("welcome to the world"); this statement execute infinite time
wizard
Feb 27th, 2007
It will print one time only, bzc after fork there is no printf statments. the printf statement is before fork so for parent it will print.
In case of array of characters we need a null pointer because after we get the output we press the enter key which takes 1 ASCII character value and as a result we need the null character.But in case ...
No Ali null is not equal to '' it was nul. NULL is a macro defined in for the null pointer. NUL is the name of the first character in the ASCII character set. It corresponds to a zero value. There's n...
I think segmentation fault error is dependent on the operating system you are using. I think if you run the code in Windows it will not give any error while when you run the same code in UNIX you will gate segmentation fault.
It will give a sementation faultThe pointer a is allocated just sufficient space to accomodate "Hello". When we add beyond that it will give a seg fault