This is getting annoying
I was long enough trying to fix this, but i have to ask you how to fix this because I have no ideas anymore.
#include <iostream>
#include <cstdarg>
using namespace std;
void add(const int &number, ...)
{
double sum = 0.0;
va_list list;
va_start(list, number);
for (int i = 0; i < number; i++)
sum += va_arg(list, double);
va_end(liste);
cout << "Sum: " << sum << endl;
}
int main()
{
add(12, 12);
}
This is my code. I get the error, that list
ist not initiaized and i get the error, that the va_start
argument must not have reference type and it must not be parenthesized. pls help