#include <stdio.h>
int main(void)
{
int text[20];
int i = 0;
printf("put the word : ");
scanf_s("%s", text, sizeof(text));
while (text[i] != '\0')
i++;
printf("%s \n", text);
printf("it's made of %d letters \n",i);
return 0;
}
뭐가 잘못됬길래 i 값이 항상 28로 일정하게 나오지?
while 문에서 '' 가 아니고 '\0' 임
\0
헭
오타 있는데 while 문에서 '' 가 아니고 0임
천재네, int 에다가 문자열 입력 받기 ^_^