Argc(argument count) and argv(argument value) are used in main function when we are passing arguments through command line.View more random threads:
- What are constant members functions in c++ 2011
- f i use hints for book ie(c++ How to Program 5th Edition)...
- Initilization of Data Member in c++ 2011
- AVL tree, It must satisfie the 2 conditions.
- if we have a program to check, how we can tell how many...
- The number in two arrays after taking these number the...
- how i can leave spaces between my program output
- What is difference among main() int main() void...
- What is the syntax of copy constructor in c 2011
- Regarding variable declaration, i know about interger types
The first argument (argc) shows the number of elements in the array, while the second argument(argv) is the actual array.
Example
#include <iostream.h>
using namespace std;
int main(int argc, char* argv[])
{
cout << "argc = " << argc << endl;
for(int i = 0; i < argc; i++)
cout << "argv[" << i << "] = " << argv[i] << endl;
system("pause");
}
Sponsored Links
There are currently 1 users browsing this thread. (0 members and 1 guests)