sepp2k's Profile User Rating: *****

Reputation: 2270 Grandmaster
Group:
Mentors
Active Posts:
3,496 (2.28 per day)
Joined:
21-June 11
Profile Views:
58,189
Last Active:
User is offline Private
Currently:
Offline

Previous Fields

Country:
DE
OS Preference:
Linux
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
C/C++, Functional Programming, Java, Python, Computer Science
Icon   sepp2k has not set their status

Posts I've Made

  1. In Topic: orphaned default

    Posted 18 Aug 2015

    Switch (area1); is a method call to a non-existent method named "Switch". It is not the start of a switch statement. That would be switch(area1) {.

    case1: etc. are label definitions. They are not cases of a switch statement. That would be case 1: etc. with a space after the case keyword.

    So you get an error about default being "orphaned" because it's not inside a switch statement (because you didn't correctly write a switch statement). You don't get the same error about your previous uses of case because you didn't actually use case. If you had spelled the cases correctly (i.e. with a space), you'd have gotten the equivalent error (i.e. "orphaned case") for them as well.
  2. In Topic: im reviewing a structure walkthrough

    Posted 17 Aug 2015

    x->r is a shortcut for (*x).r, so what is happening is that x, which is an A pointer, is dereferenced and then the field r is accessed on the resulting A. And then the value of the field is stored in the variable i.
  3. In Topic: Logical Not Confusion

    Posted 17 Aug 2015

    !cPoint simply calls the operator ! on cPoint. This will return 1 for the reason you said. And that's it. There's no negation here. The ! is just a call to the overloaded operator, it does not invoke the boolean negation operator.
  4. In Topic: static_cast

    Posted 14 Aug 2015

    static_cast<int>(poo) doesn't change poo in any way. It simply "returns" (using scare quotes because static_cast isn't a function and thus technically there's nothing to return from) the int value that corresponds to the value of poo (i.e. the value 97 in this case). That's what Jim means by '"return" value'.
  5. In Topic: Reason for header files

    Posted 14 Aug 2015

    All of that's still true in the version without header files though.

My Information

Member Title:
D.I.C Lover
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Years Programming:
15
Programming Languages:
Haskell, Ruby, OCaml, SML, F#, Scala, Racket/Scheme, Vala, C#, C++, Java

Contact Information

E-mail:
Private
ICQ:
ICQ  205544826
Jabber:
Jabber  sexykane86@jabber.ccc.de