Questions tagged [argc]

The number of arguments given to the program, found as a parameter to main in some languages, notably C.

argc stands for argument count, and represents the number of arguments given to the program, or main, in a command-line. It is used in conjunction with .

Keep in mind that argc also counts the program name.

Notable Stack Overflow questions:

243 questions
-6
votes
3 answers

Dynamic memory allocation for input?

I am having a lot of trouble starting my project. Here are the directions: "Complete counts.c as follows: Read characters from standard input until EOF (the end-of-file mark) is read. Do not prompt the user to enter text - just read data as soon…
user3321551
  • 123
  • 2
  • 3
  • 15
-7
votes
1 answer

main(int argc, char *argv[]) compromises my program

First, I should tell you that I use DEV C++ to write my program. Ok, to the point now... I wrote a program that gets input from a file named "candidates1.txt". So, the first lines are: main() { FILE *fp; fp = fopen("candidates1.txt", "r"); …
Grabenfly
  • 13
  • 5
-8
votes
3 answers

c++ only allow certain parameters to placed in argv[1]

Im trying to write some code that will only let one of four letters be entered in the argv[1] parameter. if it is another character the letter q should come up. so ive written #include #include char D, A , R, B; if(argv[1] !=…
dorie
  • 1
1 2 3
16
17