I'm doing a college assignment in C. We have to write a simple programme that just creates different data types (ints, longs, doubles) and prints them out and their size using the sizeof() function. This is the code I have written for the function that creates an int:
void createInt(){
int i = 3;
printf(int i);
printf(sizeof(int i));
}
It's giving the following errors: For "printf(int i);" it's giving: warning C4047: 'function': 'const char *const ' differs in levels of indirection from 'int' For "printf(sizeof(int i));" it's giving: warning C4024: 'printf': different types for formal and actual parameter 1
Any help would be greatly appreciated. I'm completely new to C. Have never used it before. Thanks!