1
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
2
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!
4
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.
5
Name:
Anonymous
2011-11-28 14:18
>>1
Nothing unless you tell us what it should do.
6
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.
7
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.
9
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.