Double parentheses of a function call?

c, gcc, syntax

Solution

The statement

aaa(("%dabc", 3));

calls the function `aaa` with the argument `("%dabc", 3)` which returns the value `3`.

Look up the comma operator for more information.

Problem

Consider the following code: ``` #include <stdio.h> int aaa(char *f, ...) { putchar(*f); return 0; } int main(void) { aaa("abc"); aaa("%dabc", 3); aaa(("abc")); aaa(("%dabc", 3)); return 0; } ``` I was wondering why the following lines: ``` aaa("abc"); aaa("%dabc", 3); aaa(("abc")); ``` run without error, but the fourth line (seen below): ``` aaa(("%dabc", 3)); ``` generates the following errors: main.c:15:2: warning: passing argument 1 of 'aaa' makes pointer from integer without a cast main.c:3:5: note: expected 'char *' but argument is of type `int'

Original source