c error :expected expression before 'int'

this is my demo .

#include <stdio.h>

int sqsum(int a, ...)
    va_list list;
    int b = 0,n = a;
    while(n > 0)
            b = b+n*n;
            n = va_arg(list,int);
    return b;

int main(int argc,char **argv)
    return 0;

then I compile this demo , it occurs this error ,I donot know this error mean.


If you did not include #include <stdarg.h> and it does not look like you did, then that would explain the error you are seeing, otherwise the program looks correct. If I do not include that header these are the errors I see using gcc:

In function ‘sqsum’:
13:29: error: expected expression before ‘int’

Need Your Help

Handsontable pronunciation

jquery handsontable

Silly question, but I'm anal retentive. :P