Public Group

#### Archived

This topic is now archived and is closed to further replies.

# What does ... mean?

This topic is 5705 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm reading through Programming RPG's with DirectX and I'm puzzled by a function call. void AppError(BOOL Fatal, char *Text, ...); I've seen this '...' in some other stuff as well, but have never seen an explanation for what it means. It has to be some sort of variable I'm presuming, but I have no idea what it could be. Can anybody enlighten me? Also one more thing. I know what the difference is between using the old #define preprocessor and the newer const command. But why would you use both as in the example below? Shouldn't you always use const?

#define WNDWIDTH	 400;
#define WNDHEIGHT	 400;
#define WNDTYPE	 WS_OVERLAPPEDWINDOW;

const char g_szClass[]	   =  "FrameClass";
const char g_szCaption[]   =  "FrameCaption";

The example was taken from the RPG book and I'm just wondering why the author did that. Thanks guys! quiggy.

##### Share on other sites
WRT your first question, ''...'' is a variable argument list. You can put in as many variables as you want of any type. This is a good explanation.

##### Share on other sites
Here''s the answer to the second question

#define WNDWIDTH 400;

when the compiler encountered WNDHEIGHT it would replace it with 400

if you have this

const char g_szClass[] = "FrameClass";

Then when your compiler see''s g_szClass it tells the computer where in memeory the string "FrameClass" would be located. This means that "FrameClass" would have to be stored once in the exe file and then all the code that wants it would just have a pointer to it. With the define above however the 400 gets stored everywhere it is used.

##### Share on other sites
Thanks for the link ze_jackal. Exactly what I needed...

And thanks to Mondar for the DEFINE refresher course. :-) It''s nice to see what exactly is going on behind the scene.

Quiggy.

##### Share on other sites
It''s called an ELLIPSIS.

It specifies like said a variable number of arguments to the function.

You use the va_xxx functions to work with the ellipsis to get the data off the stack frame.

Functions like printf use this so you can supply a variable number of arguments to the function.

1. 1
Rutin
23
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 32
• 41
• 23
• 13
• 13
• ### Forum Statistics

• Total Topics
631742
• Total Posts
3001989
×