Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

c++

Name: Anonymous 2011-07-09 13:12

Alright so I'm on learning C++ again.

The lines below work, but I wanted to check, with some simple tweaks I could get this running as a if program and have multiple choices like yes does "x" and no does "no" correct and any other answers would be different correct?

#include<iostream>
#include<string>
using namespace std;

int main ()
{
    string a;
    string b;
    string c;
    cout << "hello what's you're name?\n";
    cin >> a;
    cout << "hello, " << a << " how are you?\n";
    cin >> b;
    cout << "so " << a << " is doing "  << b << ".\n";
    cin >> c;
    cout << "alirght well have a good day.";
    return 0;
}

Name: Anonymous 2011-07-09 13:21

Read SICP.

Name: Anonymous 2011-07-09 13:28

I asked a simple questions, its a yes no kinda thing, not a

Here read this link kinda thing.

Name: Anonymous 2011-07-09 14:30

#include<[b]MY ANUS[/b]>

Name: Anonymous 2011-07-09 14:40

I never actually used Sepples, but what's the point of std::endl when you can simply embed a '\n' character?

Name: Anonymous 2011-07-09 15:03

>>5
Bloat.

Name: Anonymous 2011-07-09 16:29

>>4
#include<MY ANUS>

Name: Anonymous 2011-07-09 18:35

>>5
\n is not the correct newline sequence on some platforms (eg. Windows). std::endl yields a correct newline regardless of platform.

Don't change these.
Name: Email:
Entire Thread Thread List