I think that it uses the argument to get the memory address of it and thus find the addresses for the other variables. Although I want to know how to do this too, wouldn't you still want a parameter to represent the number of arguments or such?
Logically, but I was hoping there would also be a way to count the number of arguments without having to specify the number in an argument. I can't find anything on that either.
You can't. Without that first parameter, the function can't know where the other parameters are, just like how you can't know where element i of an array is without knowing where the array begins.
What are you trying to do? It can probably be done some other (better) way.
EDIT:
I was hoping there would also be a way to count the number of arguments without having to specify the number in an argument
How would that variable be stored? Well, in the memory with the other arguments, of course! So I don't see that much of a point in not including an argument to represent the number of additional ones.
Well, I'm creating an object in C++ that will draw shapes in OpenGL. I want the Shape (a class I made) object to be able to draw Shapes based on the number of Points (also a class I made) passed to it.
Passing the number of points in it's own argument wouldn't be a big deal there, but where the issue comes in is that I have a function in Shape called setColors, which is designed to set the color of each vertex. I wanted the function to be able to just loop through the array of Points created, without having to specify the number of points through via argument. I mean, I can, but it seemed like one parameter more than I needed.
I must warn you that I'm only mediocre with C++ and actually just learning OpenGL. So some advanced things, I don't really understand. And what you've done may work, but I don't really like to use things I don't understand, so would you mind explaining what is going on with that? I don't want to be a pest =/
I've never messed with custom operators either xD, but I understand it. Vectors are also something new for me, but I went and looked them up. My only other question would be why struct versus class?
A struct is for C what a class is for C++ except that the contents of a struct are public by default where as the contents of a class are private by default.
Mr Stroustrup recommends that struct be used in C++ when the contents of the body are all public. This minor economy is presumably why helios uses it. But it may say more between experts