Post your best C++ jokes, poems, stories, etc.

Pages: 1... 3456
I have a text file somewhere I wrote a year ago... let me find it.

Hmmm can't find it. It was a conversion table for Decimal, Octal and binary. I think I might have made it on my laptop actually... it had 1-10 in the three bases.


http://www.ascii.cl/conversion.htm
Conversion between base 2, 8, 10, & 16, is relatively easy, but its annoying... a task I would prefer to offload to a program. I actually started writing a conversion program for the hell of it a few days ago. It's about 50% complete.
Annoying? It is automatic. The reason those bases are commonly used is because it is easier to use them to represent binary strings...
I actually started writing a conversion program for the hell of it a few days ago. It's about 50% complete.
What the- That shouldn't take longer than a few minutes. Look, I'll do it right now:
1
2
3
std::stringstream stream;
stream <<std::hex /*(the scope may be wrong)*/ <<hex_string;
stream >>n;
It's not automatic if you need a conversion done. For example, I'm working with a mess of code that expresses all colors in base 16... well looking at it I don't know what the hell the number is so I'm going through and changing them all to base 10 to make more sense to me.

Edit: To clarify, the program I'm writing isn't some sort of conversion calculator where you enter the number, it was to make changes in bulk... then again now that I think about it I could just find and replace... damn.
Last edited on
Uh... Colors represented as numbers don't make much sense regardless of the base. Do you know what color is #4F89A0 (79.137.160)? Neither do I, but at least the former takes up less space. And the more obvious colors like gray (#808080) are easier to read in hex.
I used to be heavily into web development so unfortunately I have many colors memorized in RBG format not in hex. Not that I didn't use hexadecimal color codes, I just found it easier in RGB format.
HTML colors are in RGB format:

#RGB
#RRGGBB

etc. So, for pure red:

#F00
#FF0000

etc. Something like a mid-range green:

#080
#008800

etc. Get a little fancy and mix some blue in there:

#008820

etc.

You just have to know your hexadecimal values. That's all.
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg."
- Bjarne Stroustrup

There are others about C++ making multiple instantiations of your foot all of which get shot...
Last edited on
It's already been posted, and it's not only not a joke, it's not even funny. Everyone here has seen that phrase no less than a hundred times. Any comedy value is long gone.
Last edited on
lol Duoas
So classic...but is it C related?
RGB is easier to remember than Hex numbers. By RGB I'm referring to something like RGB(255, 255, 255). Although technically #FFFFFF should be RGB(225, 225, 225) seeing as F is 15 and 152 is 225...
[0xFF means 225]
F is 15 and 15^2 is 225

*Horrified look*
Please don't write any base conversion code until you've studied the subject thoroughly.

15*16^1+15*16^0=255
Why is it 15*16? I thought F in Hex was 15 in Dec...
becouse it's base 16. it's like in base 10 99=9*10^1+9*10^0
Last edited on
Oh ok.
What kind of math are they teaching these days....
"RGB is easier to remember than Hex numbers"?

The two are completely different things!
Pages: 1... 3456