• Welcome to Valhalla Legends Archive.
 

[C++] Typedefs

Started by MyndFyre, May 11, 2004, 07:35 PM

Previous topic - Next topic

Mephisto

#15
It's not hard to comprehend if you actually take a minute to think about what an array/pointer is...

Also, it might be helpful for you when you get into more advanced C/C++ programming which uses a heavy use of pointers and references, just keep logically in mind where the pointer is pointing to.

Also, as Raven pointed out the preprocessor has policy against whitespace.  ;)
It has an entirely different syntax and is not part of the C/C++ language IIRC.  An example of whitespace violation would be in the use of defining macro functions:

#define theMacro(x, y) x + y
v.s.
#define theMacro (x, y) x + y

The first declaration is in fact a macro function which takes in arguments x and y and adds them together.
The second declaration is really a constant because of your whitespace violation.  Wherever theMacro is seen, it will be replaced with the string "(x, y) x + y".  This also suggests that the preprocessor essentially doesn't really care about whitespace...but you do get different results based on your whitespaces, and even parenthasis with macro functions (but just as anything in C/C++).

MyndFyre

Quote from: Mephisto on May 12, 2004, 01:59 PM
The point I was making was how it worked to an extent.

As for your question, the reason there is a difference between the two, IIRC, is  because typedef did not exist in C, and only the preprocessor defines were avaliable.  

Nope.

Mephisto, learn about the features of C.  You'll find there are many that happen to be in C++.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Maddox

Quote from: Myndfyre on May 29, 2004, 02:01 PM
Quote from: Mephisto on May 12, 2004, 01:59 PM
The point I was making was how it worked to an extent.

As for your question, the reason there is a difference between the two, IIRC, is  because typedef did not exist in C, and only the preprocessor defines were avaliable.  

Nope.

Mephisto, learn about the features of C.  You'll find there are many that happen to be in C++.

http://forum.valhallalegends.com/phpbbs/index.php?board=30;action=display;threadid=6496;start=msg57077#msg57077
asdf.