Hello every one,
I am just beginning to learn C and I am doing this via X Code in MAC, however some of the exercises I try to input in to the compiler doesn't always work and I don't know how to fix it as I am a beginner.
here is the exercise or Code im trying to compile along with the error I get.
PHP Code:
/* EXER0205.c: Day 2 Exercise 2.5 */
#include <stdio.h>
#include <string.h>
int main(void) {
char buffer[256];
printf("Enter your name and press <Enter>:\n");
gets(buffer);
printf("\nYour name has %d characters and spaces!",
strlen(buffer));
return 0;
}
[COLOR="Red"]the error posted by the compiler is ("format '%d' expects type 'int', but argument 2 has 'size_t"")[/COLOR]
I have no idea what this means of course and I am at my end googling the answer to this problem.
please help.