So I am getting the error that va_list produces a 0xCCCCCCCC bad ptr. I know that it means that something is not being initialized right, or perhaps that its pointing off into space, but I don't see what I am doing to cause it so.
Also, I noticed that I am not placing the first argument in the function call to memory. Why so?
Also, I seem to be mixing up the sizes of my doubles and ints. Are my declarations correct?
What do you expect to happen? Do you expect to get the number of parameters passed to the function from this? That's not how variable argument lists work. The first parameter should be an unsigned long that contains the number of parameters passed to the function. This is the only way the function will know how many parameters were passed!
1 2 3 4 5 6 7 8 9
int add(unsignedlong count, ...)
{
va_list args;
va_start(args, count);
for(; count > 0; --count)
{
//Code here
}
}