I wonder if typedef and #define are the same in C. What are the differences between them?
I wonder if typedef and #define are the same in C. What are the
Share
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.
No.
#defineis a preprocessor token: the compiler itself will never see it.typedefis a compiler token: the preprocessor does not care about it.You can use one or the other to achieve the same effect, but it’s better to use the proper one for your needs
When things get “hairy”, using the proper tool makes it right