Прога вылетает с ошибкой сегментации.
Диагноз GDB:
Program received signal SIGSEGV, Segmentation fault.
0x0804889e in CReadFile::parse_string() ()
(gdb) bt
#0 0x0804889e in CReadFile::parse_string() ()
#1 0x08048bf8 in CReadFile::start() ()
#2 0x08048a37 in main ()
#3 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) quit
кусок кода :
....... private:
str[1000];
public:
parse_str[10[200];
.......... int CReadFile::parse_string()//function is complete { if(str_status==0)return 0; int num_char,num_parse_char,mass_num; num_char,num_parse_char,mass_num=0; for(mass_num=0;mass_num<10;mass_num++) //////////////////////////////////////////////////////////////////// { ////// Set zero into massif parse_string memset(parse_str[mass_num],0,sizeof(parse_str[mass_num])); ////// } //////////////////////////////////////////////////////////////////////////////// //////////////////// mass_num=0; while(1) { if(str[num_char]=='\0') // if end of string... . { parse_str[mass_num][num_parse_char]=str[num_char]; memset(str,0,sizeof(str)); break; } if(str[num_char]==' ') // if space ... . { if(mass_num>10) { return 1; } mass_num++; num_parse_char=0; while(str[num_char]==' ') { num_char++; } } parse_str[mass_num][num_parse_char]=str[num_char]; // add symbol into parse_str num_char++; num_parse_char++; } return 0; };
.........