- Portals
- The Current Year
- ED in the News
- Admins
- Help ED Rebuild
- Archive
- ED Bookmarklet
- Donate Bitcoin
Contact an admin on Discord or EDF if you want an account. Also fuck bots.
C++: Difference between revisions
imported>NoVwL delicious cake |
imported>E |
||
Line 93: | Line 93: | ||
* [[Nerd]] | * [[Nerd]] | ||
{{Softwarez}} | {{Softwarez}} | ||
{{ | {{Programming}} | ||
[[Category: Softwarez]] | [[Category: Softwarez]] |
Revision as of 19:13, 18 April 2011
C++ is C's evil twin brother. Imagine there is that guy who always ruins the fun. That is C++. It was developed by Bjarne Stroustrup at least 100 years ago and is used by fat nerds to perform black magic on their computers.
Basically, this is C with all the extended jizz jazz. But the only reason you want to use it is because of the classes. It also comes with typesafe code, multiple inheritance and backwards compatibility.
Example plz
So you want to learn it? Fine. You have to learn C first before you can make sense out of this.
#include <stdio.h> void anHero() { exit(0); } class You { public: You() { brain = true; power = 1; success = 0; } ~You() { anHero(); } void doItFaggot() { success = 0; } bool brain; int power; float success; }; int main(int argc, char **argv) { You *newfag = new You(); while (true) { newfag->power++; if (newfag->power > 9000) { newfag->brain = false; newfag->success += 0.01; newfag->power = 0; } newfag->doItFaggot(); if (newfag->success == 1) { printf("You Win The Game\n"); break; } } printf("HAHAHA DISREGARD THAT, I SUCK COCKS\n"); return 1; }
Explanation
Compile it with the compiler of your choice and execute it. You do not understand anything? Alright, let me translate into English.
- First, the program creates You
- It enters an infinite loop
- Your power is increased by 1
- If your power is not over 9000, jump to 8
- Your brain dies
- Your success increases
- Your power gets vaporized
- Alright, now you DO IT FAGGOT
- That means, you are a sick fuck and have no success.
- You get bored and leave doItFaggot
- If you are successful, You Win The Game and jump to 13
- Go back to step 3
- HAHAHA DISREGARD THAT, I SUCK COCKS
Makes sense, amirite? Okay Okay. Your exercise is to make sense out of that. Use Google and browse some C++ tutorials. Try to win the game. If you done that, you could even expand the code to greater detail, you sick fuck.
See Also
C++ is part of a series on Visit the Softwarez Portal for complete coverage. |
C++ is part of a series on Programming. [Enter the Matrix] | |
ADA • Assembly • C • C++ • COBOL • Debug • DOS • Erlang • Error • Fdisk • Fortran • Integer • Java • LOLCode • Machine Code • Matlab • MIRC Script • MUMPS • Open Source • Perl • PHP • Programming language • Python • QBASIC • Ruby on Rails • Scratch • SSH • Visual Basic
Firefox XPS IRC Attack • Safari XPS Attack • Sandworm
Bill Gates • Linus Torvalds • Weev • Goatse Security • Terry Davis • Theo de Raadt
Operating system • Warez • Notepad • Is not a bug, it's a feature • Database Error |