Thread: Keyword Super

  1. #1
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186

    Keyword Super

    Does anyone know the mingw keyword for super (referring to inheritance)?
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    super doesn't exist in C++ you just use the name of the base as in

    BaseClassName::Func();

    but then I may have misunderstood the question. It's been known to happen
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

    Re: Keyword Super

    Originally posted by johnnie2
    Does anyone know the mingw keyword for super (referring to inheritance)?
    Isnt that Java?

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    I've never seen 'super' used in C++, Java, yes, but not C++.

    *** EDIT ***

    Hmm, triple concurrence - that's a first.

    *** EDIT again ***

    ... or was it quadruple?
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  5. #5
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    super is not a keyword is C++, and I think you mean "Super Class", which means "Base Class", and neither super nor base are C++ keywords...
    none...

  6. #6
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953

    Re: Re: Keyword Super

    Originally posted by Fordy
    Isnt that Java?
    Yes it's Java...
    super is a keyword in Java, but not in C++.
    none...

  7. #7
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186

    Re: Re: Keyword Super

    Thanks to all for the disturbingly quick replies.

    Originally posted by Fordy
    Isnt that Java?
    Yes, I immediately remembered Java when I discovered I needed to jump up a class (not necessarily to the topmost base class) and set out to find the C++ counterpart. Interestingly enough, I found this in the C++ reference section, but I couldn't convince mingw to recognize the keyword, hence the question. I suppose a nonexistent keyword is a good reason. Does anyone know to what MSDN is referring here?
    Last edited by johnnie2; 01-28-2003 at 01:39 PM.
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  8. #8
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    still... the C++ counterpart is to use the base class name. _super must be a VC++ thing
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  9. #9
    Registered User johnnie2's Avatar
    Join Date
    Aug 2001
    Posts
    186
    Alright, just for fun, is there a way to emulate super and jump up a class or must you explicitly name the upper class all the time?
    "Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

  10. #10
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    how bout putting this in the class cpp file:

    #ifdef super
    #undef super
    #define super BaseClassName
    #endif

    I know it sucks so does the whole idea.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Virtual Keyword
    By Shal in forum C++ Programming
    Replies: 6
    Last Post: 05-18-2006, 11:37 AM
  2. extern keyword
    By trekker in forum C Programming
    Replies: 7
    Last Post: 06-01-2005, 01:31 PM
  3. With super powers would you:
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 09-17-2003, 11:27 PM
  4. how to search a keyword in C?
    By kreyes in forum C Programming
    Replies: 2
    Last Post: 03-01-2002, 08:22 PM
  5. keyword searching in C
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 02-08-2002, 02:26 AM