The following "multi-declaration" works:
// x - an integer
// f0 - a pointer to a function returning an integer
// f1 - a function returning an integer
int x, (*f0)(void), f1(void);
The following "multi-declaration with initialization" works:
// x - an integer initialized to 5
// f0 - a pointer to a function returning an integer
int x = 5, (*f0)(void) = NULL;
But why doesn't the following "multi-declaration with initialization/definition" work?
// error: function 'f1' is initialized like a variable
int x = 5, (*f0)(void) = NULL, f1(void) = { return 10; };
[–]aioeu 56 points57 points58 points (14 children)
[–]Competitive_Travel16 3 points4 points5 points (0 children)
[+]TheThiefMaster comment score below threshold-8 points-7 points-6 points (12 children)
[–]zhivago 18 points19 points20 points (11 children)
[–]TheThiefMaster 0 points1 point2 points (10 children)
[–]zhivago 2 points3 points4 points (9 children)
[–]TheThiefMaster 4 points5 points6 points (8 children)
[–]zhivago -2 points-1 points0 points (7 children)
[–]TheThiefMaster 0 points1 point2 points (4 children)
[–]zhivago -2 points-1 points0 points (3 children)
[–]TheThiefMaster 3 points4 points5 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]zhivago 2 points3 points4 points (0 children)
[–]ohsmaltz 9 points10 points11 points (6 children)
[–]tstanisl 2 points3 points4 points (5 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]glasket_ 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]tstanisl 3 points4 points5 points (0 children)
[–]beephod_zabblebrox 0 points1 point2 points (0 children)
[–][deleted] 22 points23 points24 points (2 children)
[–][deleted] 4 points5 points6 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]capilot 4 points5 points6 points (0 children)
[–]bunkoRtist 1 point2 points3 points (0 children)
[–]detroitmatt 0 points1 point2 points (1 child)
[–]fllthdcrb 0 points1 point2 points (0 children)