Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:56:27+00:00 2026-06-15T18:56:27+00:00

I am creating a child process and passing some arguments to it. Now, the

  • 0

I am creating a child process and passing some arguments to it.

Now, the child process starts execution from the next line of code, but will I have to write another int main () separately for the child process, as below, or would it just use the already written code for int main() of the parent process?

    createProcess(All required arguments);
    if (pid == child_process)
    {
       int main ()
       {
        ......
       }
    }

ENV: WinXP, VS2005
NOTE: The above code just describes the flow and may have syntax errors.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:56:29+00:00Added an answer on June 15, 2026 at 6:56 pm

    Are you confusing Windows CreateProcess with UNIX fork()? The two operating systems are different in the way that processes are created. With Windows you have to execute an exe file from the beginning, you can’t continue as the child process after CreateProcess as you can with fork on UNIX. Your statement “the child process starts execution from the next line of code” is mistaken for Windows.

    Mind you, your code would be illegal on UNIX as well, you can’t have two functions called main, and you can’t have nested functions in C.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a child process, and reading its output. My code works fine
When creating a child process in C++ using Windows API, one can allow inheritance
After creating a child process and exiting it immediately (_exit()), I want to perform
I am making a server and I use fork() for creating child processes but
Microsoft played safe here. In their article, Creating a Child Process with Redirected Input
I'm creating child processes in a for -loop. Inside the child process, I can
Program calculates sum of numbers from 1 to N.. Child process calculates sum of
The following code sends messages from child processes to their parents using socket pairs.
I am creating a child process with creatprocess api.And i created a jobobject and
I'm creating child processes with fork() in C/C++. When the parent process ends (or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.