{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

argtest

argtest - int main(int argc char*argv const char*tmp int i...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* * Program to test argument passing: it displays the argc and all * of argv, and then exits. * * Intended for the basic system calls assignment. This may help * debugging the argument handling of execv(). */ #include <stdio.h>
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int main(int argc, char *argv) { const char *tmp; int i; printf("argc: %d\n", argc); for (i=0; i<=argc; i++) { tmp = argv[i]; if (tmp==NULL) { tmp = "[NULL]"; } printf("argv[%d]: %s\n", i, tmp); } return 0; }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online