I came across some code containing the following:
struct ABC {
unsigned long array[MAX];
} abc;
When does it make sense to use a declaration like this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It allows you to pass the array to a function by value, or get it returned by value from a function.
Structs can be passed by value, unlike arrays which decay to a pointer in these contexts.