Skip to main content
GameDev.net gamedev.net
🔒 Locked

ms vc++ help

Started by ilavos Aug 3, 2004 at 7:02 PM 4 replies 850+ views
Original Post
ilavos
ilavos
ok.explain this to me like you would to a 12 year old,how on god green earth do i make a c++ program run with this fu.... thing??It keeps giving me error signals,even a simple cout >>" hello"; isnt working.Step by step strait for the dummies type tutorial needed here.
Wavarian
Wavarian
#include <iostream.h>void main(){cout << "Hello World\n";}


>> only works when using cin, ie:

cin >> variable;

Edit: the "cout" and "cin" functions are just 2 of the many functions defined in the header file "iostream.h".
Bugdude
Bugdude
Further to what Wavarian has said, you will need to create a project first. The simplest project to start with is a "Win32 Console Application".
CpMan
CpMan
Get rid of the .h on the end of iostream

then do

#include

int main() {
std::cout << "Hello World";
return 0;
}
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.
Lyost
Lyost
an alternative when using iostream (without the .h) to having to put std:: in front of all your cout and cin's is to do:

#include
using namespace std;

int main()
{
cout << "Hello, World\n";
return 0;
}

sorry, accidently double posted (and forgot to fill in my passwd the first time)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.