i have a file data.txt
and i want to read the data form the file and write them to screen
file data is :
1 2 3 ;
Code:int i,j=0,dat[256]; ifstream fin; char *line,*data; fin.open("data.dat"); fin.getline(line,256); while(fin) { i = 0; while(line[i] != ' ; ') { k = 0; while(line[i] != ' ') //while the char is not space ex: 10 5 4; { data[k] = line[i]; } k = 0; dat[k] = atoi(data); //is that true?? } } }