It's raining outside, it's going to be a long cold weekend and the dog is tired of pretending to understand what I'm saying....
Can't complain of the sound track though, Cool Breeze by The Jeremy Spencer Band is current playing.
So I thought of picking your brains a title if you don't mind.
In C++ I can do this kind of shenanigans:
void TheClass::reallyCoolMethod (const unsigned (¬_very_important)[4] = { }) { }The compiler will understand that the method expects an array of size 4 and if none is provided, it will use a static zero initialized array.
In C though, I can do something similar that is significant to the user, but not guarantied by the compiler since the size 4 array will just be a variable pointer array for the function abuse as it wishes. That is not really a problem, I'm not allergic to regular pointers, have an understanding of how arrays work in memory and how to keep things tight.
What is driving me crazy is HOW to pass a {0,0,0,0} to the damn function?!?!
Most of the time the parameter in not important, there will not be an formal array with meaningful values, I just want to do:
//assume very crussial code here!
muchMoreInterestingCFunction ({0,0,0,0});So, what is the proper syntax for in place casting a static array as function parameter in pure C?
Also, how are you guys searching for just C results in google and such? Because it apparently can´t care less for the distinction of C and Cpp on the results.....