Sign in to follow this  
Beem

Check Out This Awesome C++ Lesson

Recommended Posts

Beem    127
I taught my friend C++ over Steam chat, here's how it went.. Enjoy.

5:37 PM - Jack: Also you need to put semicolons all over the place.
5:37 PM - Jack: There's not much ryhme or reason as to where you put them, but trsut me, you need them.
5:39 PM - Scamster: [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
5:40 PM - Jack: Whenever some comes to me and says their game is broekn, I tell them it's probably a semicolon, and it almost always is.
5:40 PM - Jack: No why I say there is no rhym or reason is because...
5:40 PM - Jack: class SomeClas { }; <= needs semicolon
5:40 PM - Jack: but
5:41 PM - Jack: namespace SomeNamesapce {} <= doesn't ened semicolon.
5:41 PM - Jack: And...
5:41 PM - Jack: switch(somevalue){} <= doesn't need semicolon.
5:41 PM - Jack: but.
5:41 PM - Jack: enum SOMENUM{}; <= needs semicolon.
5:41 PM - Jack: Also
5:41 PM - Jack: for(int i=0; i<3; i++){} <= has semicolons in weird places, but doesn't need one at the end.
5:42 PM - Jack: What's alright though is if you add a semicolon where you don't need one, in many cases it's okay.
5:42 PM - Jack: not the namespace one thugh. Edited by Beem

Share this post


Link to post
Share on other sites
Cornstalks    7030
[quote name='Alan Greenspan' timestamp='1353631940' post='5003349']
Wow. You're funny. Not.
[/quote]
Wow. You're funny. Not.

@OP: I appreciated it :)

Share this post


Link to post
Share on other sites
[quote name='Cornstalks' timestamp='1353632933' post='5003350']
[quote name='Alan Greenspan' timestamp='1353631940' post='5003349']
Wow. You're funny. Not.
[/quote]
Wow. You're funny. Not.

@OP: I appreciated it [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

You've got to be kidding me, this sounds like a joke some tween who just started learning C++ made to his friend who knows nothing about programming.

Share this post


Link to post
Share on other sites
Cornstalks    7030
[quote name='Alan Greenspan' timestamp='1353634503' post='5003355']
[quote name='Cornstalks' timestamp='1353632933' post='5003350']
[quote name='Alan Greenspan' timestamp='1353631940' post='5003349']
Wow. You're funny. Not.
[/quote]
Wow. You're funny. Not.

@OP: I appreciated it [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

You've got to be kidding me, this sounds like a joke some tween who just started learning C++ made to his friend who knows nothing about programming.
[/quote]
I have a decent response for that, but I'm not going to feed the troll. It just sucks you have to be a kill joy on this site.

Share this post


Link to post
Share on other sites
RLS0812    3043
Killing joy is my job here: [img]http://public.gamedev.net//public/style_emoticons/default/angry.png[/img]

In responce to OP - Interesting topic, but I fail to see the humor in the post

Share this post


Link to post
Share on other sites
Bacterius    13165
It's not really funny (at least to me, and I know a bit of C++) because semicolons in C++ actually have do a rhyme and reason to them, except perhaps the namespace one. But that's just my opinion, no one else's and unlike the (now banned) member above, I do not draw unwarranted conclusions from it.

Share this post


Link to post
Share on other sites
way2lazy2care    790
I smiled and then remembered it was morning. It's generally much better advice than any advice I would have given when I was starting ("Just keep trying to turn all the *s into &s or ->s until it compiles").

Share this post


Link to post
Share on other sites
SymLinked    1233
[quote name='Beem' timestamp='1353289535' post='5002193']
5:40 PM - Jack: Whenever some comes to me and says their game is broekn, I tell them it's probably a semicolon, and it almost always is.
[/quote]

Like that would [b]break[/b] their game. It won't even compile.
Not funny. [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img]

Share this post


Link to post
Share on other sites
Madhed    4095
[quote name='Beem' timestamp='1353289535' post='5002193']
5:40 PM - Jack: Whenever some comes to me and says their game is broekn, I tell them it's probably a semicolon, and it almost always is.
[/quote]

im hertbroekn

[img]http://public.gamedev.net//public/style_emoticons/default/tongue.png[/img]

Share this post


Link to post
Share on other sites
[quote name='Shippou' timestamp='1353648061' post='5003381']
Killing joy is my job here: [img]http://public.gamedev.net//public/style_emoticons/default/angry.png[/img]
[/quote]
That's very hard to do when you have an utterly adorable red fox as your avatar. [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img]

Share this post


Link to post
Share on other sites
RLS0812    3043
[quote name='Servant of the Lord' timestamp='1353696762' post='5003554']
[quote name='Shippou' timestamp='1353648061' post='5003381']
Killing joy is my job here: [img]http://public.gamedev.net//public/style_emoticons/default/angry.png[/img]
[/quote]
That's very hard to do when you have an utterly adorable red fox as your avatar. [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img]
[/quote]
I need a more menacing avatar ....

Share this post


Link to post
Share on other sites
JTippetts    12951
[quote name='phantom' timestamp='1353713630' post='5003603']
Someone called for a menacing avatar? [img]http://public.gamedev.net//public/style_emoticons/default/happy.png[/img]
[/quote]

y helo thar

Share this post


Link to post
Share on other sites
L. Spiro    25622
[quote name='Shippou' timestamp='1353709320' post='5003593']
I need a more menacing avatar ....
[/quote]
Rawr.

Consider yourself avatar-menaced.

What I find funniest about this topic is that Alan Greenspan was banned. Was it because of this topic or was there another topic somewhere where a moderator told him off before banning? Can’t view his profile to check his posts to find it.


L. Spiro Edited by L. Spiro

Share this post


Link to post
Share on other sites
Cornstalks    7030
[quote name='L. Spiro' timestamp='1353724738' post='5003645']
What I find funniest about this topic is that Alan Greenspan was banned. Was it because of this topic or was there another topic somewhere where a moderator told him off before banning? Can’t view his profile to check his posts to find it.
[/quote]
He was a GameDev troll who's been around before. [url="http://www.gamedev.net/topic/631115-911-never-forget/"]Thread 1[/url]. [url="http://www.gamedev.net/topic/631064-how-do-i-make-a-game/"]Thread 2[/url]. [url="http://www.gamedev.net/topic/631397-howdy-i-have-an-idea/"]Thread 3[/url] (likely him). [url="http://www.gamedev.net/topic/630911-valve-introduce-greenlight-fee-is-100-too-much/page__st__20"]Thread 4[/url] (his post was deleted in this one, but it's been quoted). etc. These are just the ones I can find with a quick google. I don't know if there were any private messages or stuff, though.

I'm surprised this thread went the way it did and didn't turn into something like [url="http://www.gnu.org/fun/jokes/declarations.html"]this[/url]... But I've not been disappointed.

Share this post


Link to post
Share on other sites
ApochPiQ    23011
There's perfect reason to the semicolon rules in C/C++.


You need a semicolon after a } any time you are working with something that can be instantiated. Otherwise, you don't.

This is to support the following syntax:

[code]struct Foo
{
int member;
} InstanceOfFoo;

InstanceOfFoo.member = 42;[/code]


Can you instantiate structs? Check. Classes? Check. Enums? Check. Namespaces? Nope! Therefore, namespace does not need a trailing semicolon. (For that matter, functions and the bodies of code blocks follow the same pattern.)

Share this post


Link to post
Share on other sites
Icebone1000    1958
[quote name='ApochPiQ' timestamp='1353742709' post='5003696']
There's perfect reason to the semicolon rules in C/C++.


You need a semicolon after a } any time you are working with something that can be instantiated. Otherwise, you don't.

This is to support the following syntax:

[code]struct Foo
{
int member;
} InstanceOfFoo;

InstanceOfFoo.member = 42;[/code]


Can you instantiate structs? Check. Classes? Check. Enums? Check. Namespaces? Nope! Therefore, namespace does not need a trailing semicolon. (For that matter, functions and the bodies of code blocks follow the same pattern.)
[/quote]
tell that do/while loop
;D

-edit-
I see now the "after }" you mentioned..
anyway I found a discussion on the do while semicolon:
http://stackoverflow.com/questions/942251/in-c-c-why-does-the-do-whileexpression-need-a-semi-colon Edited by Icebone1000

Share this post


Link to post
Share on other sites
[s]Red name [i]without[/i] strikethrough is reserved for moderator names.[/s] [b][Edit:][/b] Whoops, that was a previous version of the site. Ignore that. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
Cornstalks    7030
[quote name='Dynamo_Maestro' timestamp='1353781990' post='5003789']
The 'Banned' status is very misleading with the strike-through, I thought it meant he was unbanned from a previous ban
[/quote]
Heh, yeah, I'd vote for a strikethrough name (normal color) with red Banned tag (no strikethrough).

As for menacing avatars, I almost changed my avatar one of the frames from [url="http://www.chiefsplanet.com/BB/attachment.php?attachmentid=55242&stc=1&d=1142920093"]this[/url] to illustrate how I was feeling at the time... nothing was working ha.

Share this post


Link to post
Share on other sites
slicer4ever    6760
[quote name='Cornstalks' timestamp='1353785969' post='5003802']
I almost changed my avatar one of the frames from [url="http://www.chiefsplanet.com/BB/attachment.php?attachmentid=55242&stc=1&d=1142920093"]this[/url] to illustrate how I was feeling at the time... nothing was working ha.
[/quote]

o god, that's awesome!=-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this