, 내가C의 문자열을 통해 반복은 분할 오류 (코어 덤프) 아래의 코드를
Segmentation fault (core dumped)
오류 메시지가 무엇입니까, 사람이 제발 도움이 될 수 있습니다?
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char s[] = "helloWorld";
int i;
for(i = 1; i < strlen(s); i++)
{
printf("Letter is %s\n", s[i]);
}
return(0);
}
이 C에서 귀하는 segfault의 원인이 있지만, 배열이 제로를 기반으로하지 않습니다. 귀하의 루프는 i = 0으로 시작해야합니다. –