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

Pages: 1-

question

Name: Anonymous 2011-11-28 13:37

#include <iostream>
 using namespace std;
 int main()
 { 
    cout << "Calculator" << endl;
    cin >> "Dec: " >> dec >> 255 >> endl;   
    cout << "Bin: " << bin << 255 << endl;  
    cout << "Hex: " << hex << 255 << endl;
    cout << "Oct: " << oct << 255 << endl;
 }

what is wrong with this code

Name: Anonymous 2011-11-28 13:47

It's written in C++.

Other than that, using namespace std;, the cin line, the line with bin, the lack of return 0; and usage of iostream altogether. Also, lack of a var if you want it to work as a dec to bin, hex and oct converter.

Get of /prog/ and don't return until you can write non-trivial code in a real language, please!

Name: Anonymous 2011-11-28 13:50

>>2
s/Get of /Get off /

Name: Anonymous 2011-11-28 14:12

>>2
return 0 is not strictly needed in the particular case of main().

Put that aside, agreed with the rest of the observations.

Name: Anonymous 2011-11-28 14:18

>>1
Nothing unless you tell us what it should do.

Name: Anonymous 2011-11-28 14:57

>>2

>bitching about C++
>on a programming board
>with regards to a newbie question

Oh, stop being a fag.

Name: Anonymous 2011-11-28 15:57

>>6
It's actually not really a programming board.  Don't worry, we all made the same mistake when we first came here.

Name: Anonymous 2011-11-28 16:07

>>6
Back to the imageboards, please.

Name: Anonymous 2011-11-28 16:13

It's actually an elitism board with a programming theme. And also some retards hang out here pretending to be retards.

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