| | |
c coding on linux
![]() |
•
•
Join Date: Feb 2007
Posts: 1
Reputation:
Solved Threads: 0
someone please help me on how to run this coding using knoppix linux.. using c language.. i really need help.. i want to know.. what is the output.. this is the coding :-
-please, i need your help
C Syntax (Toggle Plain Text)
int main() { Pid_t pid; /* fork another process */ pid=fork(); if (pid<0) { /* error occured */ fprintf (stderr,"fork failed"); exit(-1); } else if (pid==0) { /* child process */ execlp("/bin/ls","ls",NULL); } else { /* parent process */ /* parent will wait for child to complete */ wait (NULL); printf ("Child Complete"); exit(0); } }
-please, i need your help
Last edited by Ancient Dragon; Feb 4th, 2007 at 4:27 am. Reason: add code tags
•
•
•
•
someone please help me on how to run this coding using knoppix linux.. using c language.. i really need help.. i want to know.. what is the output.. this is the coding :-
C Syntax (Toggle Plain Text)
int main() { Pid_t pid; /* fork another process */ pid=fork(); if (pid<0) { /* error occured */ fprintf (stderr,"fork failed"); exit(-1); } else if (pid==0) { /* child process */ execlp("/bin/ls","ls",NULL); } else { /* parent process */ /* parent will wait for child to complete */ wait (NULL); printf ("Child Complete"); exit(0); } }
-please, i need your help
It's hard to be humble when you're as gifted as I am at pretending to be an expert.
It probably will, although you'll need the lines
at the top of your program to have the slightest chance of compiling it.
C Syntax (Toggle Plain Text)
#include <sys/types.h> #include <unistd.h>
"Technological progress is like an axe in the hands of a pathological criminal."
![]() |
Similar Threads
- Virus scanner file(php) cannot be executed (PHP)
- Hello, Everybody (Community Introductions)
- Linux for my PC (Getting Started and Choosing a Distro)
- Which linux (Getting Started and Choosing a Distro)
- how long does it take to learn assembler and how difficult is it? (Assembly)
- Shuting down Linux Cluster using Telnet (*nix Software)
Other Threads in the C Forum
- Previous Thread: WinSNMP
- Next Thread: implement semaphore without the use of while or any if statement
| Thread Tools | Search this Thread |
#include * ansi array arrays asterisks binarysearch calculate centimeter changingto char character convert copyanyfile copyimagefile copypdffile creafecopyofanytypeoffileinc createprocess() database dynamic execv fflush fgets file floatingpointvalidation fork forloop function getlogicaldrivestrin givemetehcodez grade gtkwinlinux histogram homework i/o ide inches include infiniteloop input interest intmain() iso keyboard km license linked linkedlist linux list looping lowest matrix meter microsoft mysql number oddnumber open opendocumentformat openwebfoundation pdf pointer posix power probleminc process program programming pyramidusingturboccodes radix read recursion recv recvblocked research reversing scheduling segmentationfault send sequential single socket socketprogramming stack standard strchr string suggestions systemcall test threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windowsapi






