cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
What is a situation where it makes a dif
What is a situation where it makes a difference whether you leave main() blank vs if you put int argc, char *argv[] there?
May 1, 2014 at 5:18pm UTC
Kwestion
(3)
A lot of times in programs I see
int main(int argc, char *argv[])
but then I put them in my IDE with just
int main() and they work fine. What is the point?
May 1, 2014 at 5:24pm UTC
ResidentBiscuit
(4459)
The former,
int
main(
int
argc,
char
*argv[])
is used when your program is using
command line arguments
. If you're not planning on using them, no need to include the two arguments.
May 1, 2014 at 5:41pm UTC
Little Bobby Tables
(1079)
http://www.cprogramming.com/tutorial/lesson14.html
thats where i learned how to use them from. if you want a parser, then i suggest boost.program_options or getopt (the c way)
Topic archived. No new replies allowed.