Command Line Arguments


  Top Tutorials     New Tutorials     Submit     Login     Register  

Tutorial Detail

Command Line Arguments

So here is four short programs that simply output these arguments.
  • Total Hits: 12813

  • Average Rating :
    URL RatingURL RatingURL RatingURL RatingURL Rating


  • Total Votes: 139 votes

  • Category: C and C++/General Development

  • Submitted on: 2008-04-16 02:18:50

  • Submitted By: Shekhar

  • Set as Favorite


Recently in a couple class projects I have needed to use command line arguments, and the first time dealing with these can be a little confusing. So here is four short programs that simply output these arguments.

What I mean by this is that I need to accept a string while I am calling the program name. For example I am running my program called printString and I want it to display the text hello. So I run it like so

./printString.c hello    More detail...

Rating Detail

 Stars  Percentage  Total Vote
 One star  Vote LeftVote MiddleVote Right 38.85%  54
 Two starsTwo star  Vote LeftVote MiddleVote Right 10.07%  14
 Three starsThree starsThree stars  Vote LeftVote MiddleVote Right 11.51%  16
 Four starsFour starsFour starsFour stars  Vote LeftVote MiddleVote Right 10.79%  15
 Five starsFive starsFive starsFive starsFive stars  Vote LeftVote MiddleVote Right 28.78%  40

Caste Your Vote

 Rating  Selection  Guidelines
 Poor:     Very disappointing, useless.
 Fair:     Below average, disappointing but not useless.
 Good:     About average in its class.
 Very Good:     Above average for its category.
 Excellent:     One of the best Tutorials in its category.