Advertisement

ms vc++ help

Started by August 03, 2004 07:02 PM
4 comments, last by Lyost 20 years, 3 months ago
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.
#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".
Advertisement
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".
Get rid of the .h on the end of iostream

then do

#include <iostream>

int main() {
std::cout << "Hello World";
return 0;
}
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.
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;
}
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 <iostream>
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)

This topic is closed to new replies.

Advertisement