Solved

what does "SUPER " mean?

Posted on 2001-07-09
4
310 Views
Last Modified: 2008-03-06
in the following:

#define SUPER TTActor

what does "SUPER " mean?

tks

0
Comment
Question by:she25
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 30 total points
ID: 6267479
It means "TTActor"

Anythign else?  :-)

what you are looking at is a C Pre-processor statement (any statement that begins with "#" at the start of the line.)  In this case it is a pre-processor #define statement.  This statement is used to create pre-procssor definitions and macros.

In this case it creates a pre-processor defintion.  The definition is for the word "SUPER"  which it defines as "TTActor"  The pre-processor will look through the code and will look for any occurance of "SUPPER" in the code (not in comments or strings) an will replace it with "TTActor".

continues

0
 
LVL 4

Expert Comment

by:newmang
ID: 6267484
It doesn't "mean" anything. The line creates an "alias" for TTActor named SUPER.

For example

#define BUFFSIZE 256
char   sz_buffer[BUFFSIZE+1];

strncpy(sz_buffer,source_data,BUFFSIZE);

0
 
LVL 22

Expert Comment

by:nietod
ID: 6267491
So for example, if your code was like

#define SUPER TTActor

class TTActor
{
};

SUPER AnActor;

the pre-processor would convert the code to

#define SUPER TTActor

class TTActor
{
};

TTActor AnActor;

Note that this sort of use of the pre-processor is now strongly discouraged.  It was often necessary to use the pre-processor in C, but it also caused lots of problems.  So C+++ provides better alternatives for almost all the features of the pre-processor.   There are still two areas where the pre-processor stil needs to be used, it needs to be used for #include directives and for conditional compilation directives. Like the #ifdef include guards used in many include files.  (These conditional compilations situations often require that #define be used, but the vlaues defined are only used by the pre-processor, they do not direcly affect the code.)
0
 
LVL 22

Expert Comment

by:nietod
ID: 6267498
This

>> #define BUFFSIZE 256
>> char   sz_buffer[BUFFSIZE+1];

is one of the things that the pre-processor should not be used for. (In C++, it was necesary in C.).  For example the code

const int BUFFSIZE = 256;
char   sz_buffer[BUFFSIZE+1];

is far better.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question