View Full Version : C++ help
TylerDurden
Oct 6th, 2008, 01:17 AM
ill start out saying i just started taking a C++ class. i missed the first day, but he told me the homework was posted online, so im trying to do this homework, and its going good expect for the fact that i dont know where to run these programs im making. im using Visual Studio, and it keeps saying my program has errors, which cant be true. here is my program. is anything wrong with it ? If not, then it must be the program im using.
// Problem 2.5
# include <iostream>
using namespace std;
int main <>
{
cout << " hi\n";
cout << " this is my program\n";
return 0 ;
}
Koobazaur
Oct 6th, 2008, 02:03 AM
your program has errors. listen to what your compiler tells you, it knows better than you.
also, visual studio what. there's a lot of visual studios, and trying to compile c++ under visual studio basic won't do you any good.
TylerDurden
Oct 6th, 2008, 02:07 AM
yeah i have visual basic 2008.
i'll get visual C++...
what i don't get is this. i took a program from the book that works, and put it in there, and it gave just about everything errors.
how do i have errors in that ? !!!!!# sfidxguisdrhgserdtgwe4sruw4eithddgg4ttttttttt..... ...............
TylerDurden
Oct 6th, 2008, 02:37 AM
omg so silly. my program works from what visual C++ says. However i don't know how to view it. i went to "build" and it complied it and said it was good.
Koobazaur
Oct 6th, 2008, 08:00 AM
press the green triangle button that looks like a tape recorder's "play" button.
also, you will see a prompt pop up and instantly disappear since your program terminates as soon as it's done and doesn't wait for user input.
EMBAR
Oct 8th, 2008, 01:15 PM
You can navigate to your project's debug directory or release directory, whatever option you have in the drop down box at the top when viewing your project. Inside, after you've compiled, will be the .exe. Use cmd.exe to navigate to that directory and run the executable. This way the prompt will stay up after the program has executed.
Edit: This is assuming VS2008 is like VS2005, what I've used most recently. Either way, depending on the project type you selected, there should be a .exe somewhere in your project folder or its subfolders.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.