B
brad2000
I was doing a little bit of reading in the ISO C spec. about
typecasting to a void type. This caused me to have a question. In
particular, I'm curious to know about section 6.3.2.2 where the specs
says "is evaluated as a void expression, its value or designator is
discarded."
If I do the following:
#include <stdio.h>
int
main(int argc, char **argv)
{
int s = 12;
printf("non-void type = 0x%x\n", s);
(void)s;
return(0);
}
What is the effect of typecasting s to a void type. Does the compiler
just treat the line as a null statement?
Thanks.
-brad walker
typecasting to a void type. This caused me to have a question. In
particular, I'm curious to know about section 6.3.2.2 where the specs
says "is evaluated as a void expression, its value or designator is
discarded."
If I do the following:
#include <stdio.h>
int
main(int argc, char **argv)
{
int s = 12;
printf("non-void type = 0x%x\n", s);
(void)s;
return(0);
}
What is the effect of typecasting s to a void type. Does the compiler
just treat the line as a null statement?
Thanks.
-brad walker