M
Mark
Hello,
this code produces warnings, but I want to understand how it's interpreted
by compiler.
#include <stdio.h>
int main(void)
{
int b;
b = (int)"hello"; /* 1 */
printf("%d\n", 3.2); /* 2 */
printf("%s\n", 1234); /* 3 */
printf("%s\n", b); /* 4 */
return 0;
}
Is the first statement legitimate? Am I right that in "1" b is evaluated to
address of string literal?
But I don't understand how can the compiler take the 2nd, 3rd and 4th
expressions?
this code produces warnings, but I want to understand how it's interpreted
by compiler.
#include <stdio.h>
int main(void)
{
int b;
b = (int)"hello"; /* 1 */
printf("%d\n", 3.2); /* 2 */
printf("%s\n", 1234); /* 3 */
printf("%s\n", b); /* 4 */
return 0;
}
Is the first statement legitimate? Am I right that in "1" b is evaluated to
address of string literal?
But I don't understand how can the compiler take the 2nd, 3rd and 4th
expressions?