hi.......We have a task to write a program in C in linux environment that takes 2 command line arguments:
1.the name of a text file that contains single-digit integer data in one line
2.an integer to be searched from the sorted version of data in file.

The prgram creates a child process that reads the text file paased as the first argument,sorts the numbers with any sorting algo,communicates the sorted numbers to parent process via a pipe and exits.The parent process searches the sorted data that it receievs from the child and displays a message informing the user of frequency of occurence of searcged digit.All priting,reading should be done by system calls.
and we not allowed to use any liibrary functions.
signature of main function is...main(int argc,char**argv)

now,i can write the code for system calls...but my major programming problem is BRINGING IT ALL TOGETHER!

PLZZZZZZZZZZZZZZZ HELP ME...HOW DO I WRTIE THE CODE FOR THIS TASK?

>HOW DO I WRTIE THE CODE FOR THIS TASK?
I believe your caps lock key is stuck. Just like any non-trivial program, you break it up into manageable chunks. Instead of trying to do everything at once, start by writing the program without using separate processes. That's simple, so once you have it working you know that there's nothing wrong with it and can spawn a child process to do the work. Once you have that working, you can then use a pipes to communicate with the parent process and you're done!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.