Jump to content

Help with C program(gcc) in Linux

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
b0b0#32

b0b0#32

    Newbie

  • Members
  • Pip
  • 1 posts
Hi... I have a project for my college but unfortunately, I struggle in programming, apart from simple C programs :confused:. Anyway, the way I see it I think the code I need should be around 20-30 lines, so if somebody can provide me some help I"ll be really grateful. Here is the project:

-A process Parent will produce 10 random integer numbers (rand).
-Then the process Parent will produce (fork) 2 processes Children.
-The processes Children will print their PID (getpid) and will sort (qsort, as <stdlib.h>) the integer numbers, the one in ascending order and the other in descending.
-The sorted tables will be printed at stdout with the use of write.
-The process Parent will standby (waitpid) until the processes Children finish their execution.

#2
asafe

asafe

    Programmer

  • Members
  • PipPipPipPip
  • 107 posts
Wrong forum, wrong way to ask help.

#3
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
What are you having difficulty with? What code do you have so far?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog