argtest - int main(int argc, char *argv) { const char *tmp;...

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(&quot;argc: %d\n&quot;, argc); for (i=0; i&lt;=argc; i++) { tmp = argv[i]; if (tmp==NULL) { tmp = &quot;[NULL]&quot;; } printf(&quot;argv[%d]: %s\n&quot;, i, tmp); } return 0; }...
View Full Document

This note was uploaded on 11/10/2009 for the course CS 536 taught by Professor Lums during the Spring '09 term at Indiana.

Ask a homework question - tutors are online