Programming Tutorials

(追記) (追記ここまで)

Command-line arguments in C

By: Jeffrey in C Tutorials on 2012年03月16日 [フレーム]

This simple C program shows the method to accept and display command-line arguments.

#include <stdio.h>
int main(int argc, char *argv[])
{
 int x;
 // using for loop to iterate all the character...
 for(x = 1; x < argc; x++)
 printf("%s%s", argv[x],(x<argc-1) ? " ": "");
 // go to a new line...
 printf("\n");
 return 0;
}



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /