Jump to content

  • Log In with Google      Sign In   
  • Create Account


Check Out This Awesome C++ Lesson


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
24 replies to this topic

#21 Icebone1000   Members   -  Reputation: 980

Posted 24 November 2012 - 11:08 AM

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:

struct Foo
{
	 int member;
} InstanceOfFoo;

InstanceOfFoo.member = 42;


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.)

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, 24 November 2012 - 11:14 AM.


Sponsor:

#22 Memories are Better   Prime Members   -  Reputation: 769

Posted 24 November 2012 - 12:33 PM

The 'Banned' status is very misleading with the strike-through, I thought it meant he was unbanned from a previous ban

#23 Servant of the Lord   Crossbones+   -  Reputation: 17153

Posted 24 November 2012 - 01:25 PM

Red name without strikethrough is reserved for moderator names. [Edit:] Whoops, that was a previous version of the site. Ignore that.

Edited by Servant of the Lord, 24 November 2012 - 01:27 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.

[Fly with me on Twitter] [Google+] [My broken website]

All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.                                                                                                                                                       [Need free cloud storage? I personally like DropBox]

Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal


#24 Cornstalks   Crossbones+   -  Reputation: 6966

Posted 24 November 2012 - 01:39 PM

The 'Banned' status is very misleading with the strike-through, I thought it meant he was unbanned from a previous ban

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 this to illustrate how I was feeling at the time... nothing was working ha.
[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#25 slicer4ever   Crossbones+   -  Reputation: 3206

Posted 24 November 2012 - 01:51 PM

I almost changed my avatar one of the frames from this to illustrate how I was feeling at the time... nothing was working ha.


o god, that's awesome!=-)
Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS