i was wondering how i would make a file automatically open with a program, eg:
like after you install dev c++, .cpp files automatically open in the editor. how does the editor get the file's location? and how does it process it?
all c and c++ programs have a main() function, and it has two optional arguments. int main(int argc, char* argv) argc is the number of command-line arguments (deliminated with spaces). argc is always > 0 because the first argument is the name of the executable program.
argv is a character array of the arguments. argv is (usually) lways the program's name
To if you type c:>myprog Hello World <Enter key> In the above, argc == 3,
argv = "myprog"
argv = "Hello"
argv = "World"