char * temp_array;
strcpy(temp_array, argv[i + 1]);
for(int j = 0; j < 8; j++)
{
fann_input[j] = atoi(temp_array[j]);
printf("%f\n", fann_input[j]);
printf("o%c\n", temp_array[j]);
}
fann_input은 부동 소수점 배열입니다.명령 행에서 부동 소수점 배열로 문자열을 변환하는 중 문제가 발생했습니다.
src/main.cpp: In function ‘int main(int, const char**)’:
src/main.cpp:117: error: invalid conversion from ‘char’ to ‘const char*’
src/main.cpp:117: error: initializing argument 1 of ‘int atoi(const char*)’
모든 아이디어를 다음 atoi 함수 라인에
, 나는 오류가?문자의 각이 중 1 또는 0
아, probing index goof ups. 나는 이미 루프 안에 있다는 것을 잊었다. 내 모든 코드를 게시 할 것이지만, 200 라인을 넘는/p – NullVoxPopuli
그러나, 그 문제를 해결하지 않습니다 – NullVoxPopuli
좋아. 글쎄, 당신이하고 싶은대로 각 캐릭터를 변환하고 있습니까? 왜냐하면 atoi()는 전체 "문자열"(널 종료 문자 배열) – MarcB