I got the simplest code to display sizeof () data type, like int.
#include <stdio.h>
int main() {
printf('%i', sizeof(int));
}
No matter what I do, for example, putofof (int) as an integer, or use 'zu' instead of 'i', it passes me this error:
error: invalid conversion from ‘int’ to ‘const char*’
Is there something wrong with my compiler? I don’t understand why I can’t print so simple sizeof..
EDIT: It seems like printf('%s', 'foo');STILL is telling me what I'm converting intto const char*, how on earth ???
source
share