I am currently taking a basic C course and I was wondering why my code below doesn't run.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char string[4];
printf("Enter some text\n");
scanf(" %c %c %c", &string[0], &string[1], &string[2]);
printf("You Entered ");
int i;
for (i = 0; i < 4; i++){
printf("%c",string[i]);
}
return 0;
}
Xcode said there is an errr with my scanf line.
I was hoping to type in "a b c d" and expect a "You entered abcd";

makeormanto build?