I am a total idiot when it comes to command line interfaces. Unfortunately I was too young to use the family apple 2c before it was replaced by a windows computer :-(
Here is my problem. I have a programming assignment (which I do not need help with, just how to use command line). It contains main.cpp, person.cpp, and person.h. Main.cpp needs to take and int argc and a char argv (the main declaration is below). Using visual c++'s command line, I am able to change directories so that I am at the correct directory (in this case it is C:\Users\-----\Documents\Visual Studio 2010\Projects\assignment 7 marketing\assignment 7 marketing\main.cpp). I have been able to navigate to C:\Users\------\Documents\Visual Studio 2010\Projects\assignment 7 marketing\assignment 7 marketing, but now what? How do I tell the command line interface to open the project, or compile it, or whatever I need to do to see how this program works? How do I pass it the correct arguments? If someone could please give me a step by step list of what commands I need to input that would be totally helpful. Thanks ahead of time.
thanks for asking. I need to compile it before I can run it, right? So how about we compile it first, then run it. I am pretty used to compiling/running .cpp files using the normal visual c++ interface, but command line is totally foreign to me. The end result is that I need to be able to run main.cpp and the associated files person.cpp and person.h (located in the same directory, etc. they all seem to compile and build properly using the normal visual c++ interface). In order to finish the assignment I will need to be able to 1). see how this program works (opening it on the command line so I can pass arguments to argc and argv) 2). recompile and run it after making the necessary changes to the program. I really appreciate you taking the time to look at my thread.
I'm not familiar with invoking the VC++ compiler from the command line, but all you really need to do is compile main.cpp and person.cpp. This command is probably as simple as cl main.cpp person.cpp. You'll want to check out documentation at MSDN to be certain.
Then to run the program, just move to the directory of the executable and then type its name followed by whatever arguments it requires.
Working from the command line isn't nearly as scary as it may seem. I personally find it much easier on a *nix system, as the Windows command-line is just utter garbage. If I'm working on Windows, I just stick in Visual Studio most of the time.