FAQ Database Discussion Community


Nested typedef structs

c,ansi-c
I'm having an issue trying to nest structs that I need to declare as new var types. The code is the following- typedef struct { typedef struct { int day, month, year; } Date; Date manuDate, purDate; double purPrice; } Car; Except when I try to compile it throws an...

Is post-increment operator guaranteed to run instantly?

c,c89,post-increment,ansi-c
Let's say I have the following code: int i = 0; func(i++, i++); The increment is happening right after returning the value? Is it guaranteed that the first argument will be 0, and the second argument will be 1?...

pow(1,0) returns 0? [closed]

c,printf,pow,ansi-c
Why does this: printf("%d\n", pow(1,0)); /* outputs 0 */ returns 0? I expected it to return 1....

How to suppress a 'missing termination character' warning in cpp?

c-preprocessor,ansi-c,picoblaze
I'm trying to use cpp (ANSI-C preprocessor) to preprocess some non ANSI-C files. These files contain assembly instruction in PicoBlaze syntax. PicoBlaze uses 'd to annotate the literal's radix. I would like to preprocess my files with cpp. I get several: <stdin>:228:163: warning: missing terminating ' character [enabled by default]...

Increment wrt TCC , GCC [duplicate]

c,increment,ansi-c
This question already has an answer here: Why are these constructs (using ++) undefined behavior? 11 answers I am skipping header files and void main... Code 1:- int a = 5 , c ; c = a++ + ++a + a++; a = 5; printf("%d %d",a++ + ++a +...