Sorry for the simple question but I’m on vacation reading a book on core audio, and don’t have my C or Objective C books with me…
What are the curly braces doing in this variable definition?
MyRecorder recorder = {0};
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.
Assuming that
MyRecorderis astruct, this sets every member to their respective representation of zero (0for integers,NULLfor pointers etc.).Actually this also works on all other datatypes like
int,double, pointers, arrays, nested structures, …, everything you can imagine (thanks to pmg for pointing this out!)UPDATE: A quote extracted from the website linked above, citing the final draft of C99: