Sign in to follow this  
ilavos

ms vc++ help

Recommended Posts

ilavos    104
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.

Share this post


Link to post
Share on other sites
Wavarian    850

#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".

Share this post


Link to post
Share on other sites
Bugdude    148
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".

Share this post


Link to post
Share on other sites
CpMan    532
Get rid of the .h on the end of iostream

then do

#include <iostream>

int main() {
std::cout << "Hello World";
return 0;
}

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
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;
}

Share this post


Link to post
Share on other sites
Lyost    328
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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this