question: from where the execution of fork command starts?????

i have searched the archives...but its not there....

On Tue, Jan 17, 2012 at 5:31 PM, shady <sinv...@gmail.com> wrote:

> answered by sunny. and output you mentioned is also wrong. search archives.
>
>
> On Tue, Jan 17, 2012 at 5:31 PM, shady <sinv...@gmail.com> wrote:
>
>>
>>
>> On Tue, Jan 17, 2012 at 4:54 PM, Durgesh Kumar <durgesh1...@gmail.com>wrote:
>>
>>> #include<stdio.h>
>>>
>>> int main()
>>> {
>>>        int i=0;
>>>         printf("hello world \n");
>>>        i++;
>>>        fork();
>>>        printf("forking %d",i);
>>>        i++;
>>>
>>> }
>>> o/p :-
>>> hello world
>>>
>>> Can any1 explain this??
>>>
>>> On 1/17/12, Durgesh Kumar <durgesh1...@gmail.com> wrote:
>>> > How can we join after the forking ????
>>> >
>>> > On 1/17/12, Durgesh Kumar <durgesh1...@gmail.com> wrote:
>>> >> #include<stdio.h>
>>> >>
>>> >> int main()
>>> >> {
>>> >>      int i=0;
>>> >>         printf("helllo world %d\n",i);
>>> >>         i++;
>>> >>         fork(); //Fork Exeution Starts from here .
>>> >>         printf("hello forking %d\n",i);
>>> >>      i++;
>>> >>
>>> >> }
>>> >>
>>> >> o/p:-
>>> >> helllo world 0
>>> >> hello forking 1
>>> >> hello forking 1
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On 1/17/12, himanshu kansal <himanshukansal...@gmail.com> wrote:
>>> >>> #include<stdio.h>
>>> >>> int main()
>>> >>> {             printf("hello");
>>> >>>                fork();
>>> >>>               printf("world");
>>> >>> }
>>> >>>
>>> >>>
>>> >>> what will be the o/p....
>>> >>>
>>> >>> on my system...its showing hello world hello world...
>>> >>>
>>> >>> but i think it could be hello world two times in any order.....
>>> >>>
>>> >>> please tell me what is the exact o/p...
>>> >>>
>>> >>> i have a little confusion also that whether child process starts
>>> >>> executing from start of the main() or whether it starts from the line
>>> >>> following the fork() command.....
>>> >>>
>>> >>> --
>>> >>> You received this message because you are subscribed to the Google
>>> >>> Groups
>>> >>> "Algorithm Geeks" group.
>>> >>> To post to this group, send email to algogeeks@googlegroups.com.
>>> >>> To unsubscribe from this group, send email to
>>> >>> algogeeks+unsubscr...@googlegroups.com.
>>> >>> For more options, visit this group at
>>> >>> http://groups.google.com/group/algogeeks?hl=en.
>>> >>>
>>> >>>
>>> >>
>>> >>
>>> >> --
>>> >> *Durgesh Kumar*
>>> >> Final Year, B.tech
>>> >> Information Technology
>>> >> HALDIA INSTITUTE OF TCHNOLOGY
>>> >> HALDIA
>>> >>
>>> >
>>> >
>>> > --
>>> > *Durgesh Kumar*
>>> > Final Year, B.tech
>>> > Information Technology
>>> > HALDIA INSTITUTE OF TCHNOLOGY
>>> > HALDIA
>>> >
>>>
>>>
>>> --
>>> *Durgesh Kumar*
>>> Final Year, B.tech
>>> Information Technology
>>> HALDIA INSTITUTE OF TCHNOLOGY
>>> HALDIA
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Algorithm Geeks" group.
>>> To post to this group, send email to algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 

       Regards
 Himanshu Kansal
   Msc Comp. sc.
(University of Delhi)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to