I'm trying to get an argument from the user through CLI. However, when I pass only string of characters...GCC warns me to start the first argument of main function with integer data type. Why is that and what is it for?
Asked
Active
Viewed 80 times
0
-
2because that's how it must be done: arg count, then arg list. – Jean-François Fabre Mar 30 '17 at 16:30
-
4Argument is int main(int argc, char* argv[]). It's has to be int for the first argument. Or else it will complain. – danglingpointer Mar 30 '17 at 16:33
-
thanks got it! It's to count the number of arguments passed.:) – Mar 30 '17 at 16:38