Answers for "c main parameters"

C
4

c++ argv

// command line arguments in c++ are stored in an array of c-strings
// # of arguments: argc
// actual arguments: argv

#include <iostream>
using namespace std;

int main(int argc, char** argv){
  for(int i = 0; i < argc; i++){
    cout << "argv" << i << ": " << argv[i] << endl;
  }
  return 0;
}

/*

./main.exe hello world

argv0: main.exe
argv1: hello
argv2: world

*/
Posted by: Guest on April-27-2020
3

main function in c

int main(int argc, char *argv[])
Posted by: Guest on October-19-2020
0

command line arguments c

int main(int argc, char* argv[]){/*...*/}
Posted by: Guest on April-06-2020

Code answers related to "C"

Browse Popular Code Answers by Language