-
July 28th, 2014, 10:53 AM
#1
Noob needs easy help with command line interface
Hi,
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 (I just need help using 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.
Code:
int main(int argc, char* argv[])
-
July 28th, 2014, 11:11 AM
#2
Re: Noob needs easy help with command line interface
You need to use Visual Studio to create, build, run and debug a project. You'll do that through the Visual Studio GUI, not a command line. That's really something you should know how to do before you post here.
-
July 28th, 2014, 11:23 AM
#3
Re: Noob needs easy help with command line interface
GCDEF,
I know how to create, build and run and debug a project through the visual studio GUI, but I don't know how to pass arguments like those required for
Code:
int main(int argc, char* argv[])
using the visual studio GUI. My teacher has given us examples, but he always used the command line interface using geany, so I assumed that the only way to pass arguments to variables like int argc and char argv was using command line. Is there another way to run a program that requires command line arguments without using command line? That's where I'm kind of hung up on this thing. I just need someone who can briefly inform this nooby which command line arguments I need to enter (and in what order!) to make main.cpp and the associated files person.cpp and person.h run using the command line interface of visual c++, at the same time passing the correct arguments to int argc and char argv. I need to see what this program does before I can get started making the required changes to it and then when I have made those changes, I need to be able to test those changes.
Thanks ahead of time!
-
July 28th, 2014, 11:31 AM
#4
Re: Noob needs easy help with command line interface
Poke around in your IDE's project configuration and other settings and you will find the place where you can enter command line arguments via your IDE.
You can also open a separate command prompt window and run your program from there with command line arguments entered at the command line.
-
July 28th, 2014, 11:41 AM
#5
Re: Noob needs easy help with command line interface
Originally Posted by anundal
GCDEF,
I know how to create, build and run and debug a project through the visual studio GUI, but I don't know how to pass arguments like those required for
Code:
int main(int argc, char* argv[])
using the visual studio GUI. My teacher has given us examples, but he always used the command line interface using geany, so I assumed that the only way to pass arguments to variables like int argc and char argv was using command line. Is there another way to run a program that requires command line arguments without using command line? That's where I'm kind of hung up on this thing. I just need someone who can briefly inform this nooby which command line arguments I need to enter (and in what order!) to make main.cpp and the associated files person.cpp and person.h run using the command line interface of visual c++, at the same time passing the correct arguments to int argc and char argv. I need to see what this program does before I can get started making the required changes to it and then when I have made those changes, I need to be able to test those changes.
Thanks ahead of time!
Go under the project properties and look at the debugging settings. You can specify command line arguments in there.
This does seem like a VC question. Not sure why the thread was moved.
-
July 28th, 2014, 12:42 PM
#6
Re: Noob needs easy help with command line interface
Originally Posted by GCDEF;2159331)anundal
This does seem like a VC question. Not sure why the thread was moved.
And what is *specific* to Visual is there in the OP:
I know how to create, build and run and debug a project through the visual studio GUI, but I don't know how to pass arguments like those required for
Code:
int main(int argc, char* argv[])
using the visual studio GUI
Function main? Or "visual studio GUI" mentioned by OP?
Well, If the forum's majority considers this question concerns the Visual aspects of C++ then we could move it back to Visual C++ forum.
Victor Nijegorodov
-
July 28th, 2014, 12:58 PM
#7
Re: Noob needs easy help with command line interface
Originally Posted by VictorN
And what is *specific* to Visual is there in the OP:
Function main? Or "visual studio GUI" mentioned by OP?
Well, If the forum's majority considers this question concerns the Visual aspects of C++ then we could move it back to Visual C++ forum.
I could be wrong, but I think he's asking how to use Visual Studio to pass command line parameters when running or debugging the app. In post number 3 he says "I don't know how to pass arguments like those required for ... using the visual studio GUI"
-
July 28th, 2014, 01:22 PM
#8
Re: Noob needs easy help with command line interface
Originally Posted by GCDEF
I could be wrong, but I think he's asking how to use Visual Studio to pass command line parameters when running or debugging the app. In post number 3 he says "I don't know how to pass arguments like those required for ... using the visual studio GUI"
OK, no problem! I will move it back!
Victor Nijegorodov
-
July 29th, 2014, 12:28 AM
#9
Re: Noob needs easy help with command line interface
GCDEF,
Just wanted to let you know that this:
"Go under the project properties and look at the debugging settings. You can specify command line arguments in there."
was the ticket. Got it working now. Thanks a million. I think someone could easily spend a semester just learning all the ins and outs of just the compiler!
Thank you everyone who took the time to post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|