What does this two snippet code mean here?
#define HTTPH(a, b, c, d, e, f, g) char b[] = "*" a ":";
void function(char *p) {
(void)p;
}
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.
The first is string concatenation through macro. It is similar to:
With this the preprocessor will concatenate STR1 & STR2 and use it in place of STR3.
Example.
The second syntax:
Means the pointer variable
pis currently unused. Unused variables seldom result in compiler warnings, Such an construct is popularly used to get rid of the unused variable warning.With
(void)p;the pointerpis used in a statement(which in reality does nothing) But it satisfy’s the compiler that the variable was used somewhere and hence it generates no warning.