Hi!
What difference is there between int main() and int main(int argc,char* argv[ ])?
Why are arguments such as argc or argv[ ]?
Thanks
Hi!
What difference is there between int main() and int main(int argc,char* argv[ ])?
Why are arguments such as argc or argv[ ]?
Thanks
Base of C/C++ : look here
rezas1000 (8th August 2014)
short answer, int main() can't take command line arguements, while int main(int argc, char* argv[]) (or char **argv) can. argc is a count of arguements, which includes the executable name itself, so `nano foo` has argc of 2, nano and foo, and you would access those via argv[0] and argv[1] respectively.
rezas1000 (8th August 2014)
Bookmarks