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

HIA GUYZ

Name: Anonymous 2007-11-21 22:44

HI GUYZ I JUT LEARNT MICOSFT VISRUAL BASIK++ AND WUZ WONDERUN WHY MEH PR0GrM WNT WORK:

sTART(NOT A vARIAEBL)
pRinTOUT(HElO WRLD)

}

WHY IT NO WRK BTW MEH CAPS LAOCK IS ON AN I DNT FEL LEIK TYPIN AGIAN OK JUST FIX IT LOL JK, THXX

Name: Anonymous 2007-11-21 23:02

Hmm, have you learnt Visual Basic or C++? I think you're getting the two confused. Given the latter case, you seem to be getting the structure of the main function incorrect. In C++, all functions have a structure like:

<return-type> <function-name>(<arguments> | [<void>])
{
    // instructions
}

Variable declarations go like:
<arg-type> <variable-name>;
Eg. int foo;
to declare a machine word sized integer.

As way of example, here is the infamous ``hello world'' program:

#include <iostream>
using namespace std;
int main(void)
{
    cout << "Hello world" << endl;
    return 0;
}


Finally, I highly recommend these books for C++:
C++: How to Program, 5th Ed., by Dietel and Dietel
The Complete Reference C++, 4th Ed., by Herbert Shcildt
Data Structures in C++ Using the Standard Template Library, by Timothy Budd

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