Related questions
What should main() return in C and C++?
What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments?
If int main() then return 1 or return 0?
There are numerous duplicates of …
Is it safe to return a struct in C or C++?
What I understand is that this shouldn't be done, but I believe I've seen examples that do something like this (note code is not necessarily syntactically correct but the idea is there)
typedef struct{
int a,b;
}mystruct;
And then …
How can I return an anonymous struct in C?
Trying some code, I realized that the following code compiles:
struct { int x, y; } foo(void) {
}
It seems as if we are defining a function named foo which returns an anonymous struct.
Does it only happen to compile with my …