| | |
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 |
* adobe ansi api array asterisks binarysearch calculate centimeter char character cm convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile createprocess() csyntax directory feet fflush fgets file floatingpointvalidation fork frequency function givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking highest homework i/o inches infiniteloop interest intmain() iso keyboard kilometer km linked linkedlist linux linuxsegmentationfault list locate lowest match meter microsoft mqqueue mysql number oddnumber odf open opendocumentformat openwebfoundation owf pattern pdf performance posix power probleminc program programming pyramidusingturboccodes read recv recvblocked repetition reversing scanf scheduling segmentationfault send single socketprograming socketprogramming stack standard string suggestions systemcall unix urboc user variable voidmain() wab whythiscodecausesegmentationfault win32api windows.h






