First C++ program (very simple problem but I'm snookered)!

[b][red]This message was edited by bigred at 2003-11-20 14:16:4[/red][/b][hr]

I have just attempted to copy the most simple C++ example out of a book. It doesn't seem to work. I am comfortable with C, but C++ is new to me. Could someone please see if they can see what's wrong?
[code]
#include

using namespace std;

int main (int argc, char *argv[])
{
cout<< "Hi there" << end1;
return 0;
}
[/code]

Comments

  • [b][red]This message was edited by stober at 2003-11-20 15:17:26[/red][/b][hr]
    [blue]What makes you think there is anything wrong with it? There is nothing wrong with that program. If you don't see anything it's because there is nothing to stop the program from closing. see [red]RED[/red] below for an example how to fix this.

    Just noticed: you misspelled the word "endl" -- the last character is an "ell", not a "one"
    [/blue]
    :
    : I have just attempted to copy the most simple C++ example out of a book. It doesn't seem to work. I am comfortable with C, but C++ is new to me. Could someone please see if they can see what's wrong?
    : [code]
    : #include
    :
    : using namespace std;
    :
    : int main (int argc, char *argv[])
    : {
    : cout<< "Hi there" << end[red]l;[/red]//1;
    [red] cin.ignore() [/red]
    : return 0;
    : }
    : [/code]
    :



  • [b][red]This message was edited by bigred at 2003-11-21 0:3:32[/red][/b][hr]
    Many thanks Stober. Amazing how: [code]l & 1 [/code]can look so similar to tired eyes.

    Thanks Red.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories