Windows API is exactly that - an application programming interface for Windows. It has all of the necessary components to make Windows applications. There are form builders and I think Visual Studio C++ has one.
This is probably a good place to try if you want to go that route. Bear in mind, you're working with a Windows specific API there. If you want cross-platform development, you'd need an alternative framework.
Look closely again at the code for the argv variable. It's not a char, it's an array of C-strings (you could write it as
if you prefer). They are picked up from whatever you pass in when you run the program from the command line (or, in some IDEs, you can set command line argument through some build settings).
So, if I had:
Then argc would be three. Remember, the first argument is always the program name. The second and third would be "hello" and "world" respectively. And since we start are indices at zero, those three arguments are stored in argv, argv and argv.
In essence, that's all they are - strings. You can pass whatever file type you like, provided you've coded the adequate solution to read it in your program.
Here's a basic example. Let's assume we have a text file, my_file.txt, in the same directory as our program. It looks like this:
And then we have our program. We're going to take the name of the file from the argument passed in and, providing we can open it, print its contents to the screen.
int main( int argc, char* argv )
if( argc < 2 )
std::cout << "No argument passed to program\n";
std::cout << "Usage: " << argv << " <filename>\n";
std::ifstream is( argv );
if( is.is_open() )
while( getline( is, line ) )
std::cout << line << std::endl;
std::cout << "Could not open file " << argv << std::endl;
So, if I compile the program, name it 'args' and run it.
> args my_file.txt
Does that clear anything up?