Я новичок в программировании C ++ и стараюсь без слишком большого успеха, чтобы использовать GetLine для чтения смешанной линии (то есть, строки и целых чисел), текстовый файл в четыре массива. Строка «Файл»: < /p>
One, two, num one, num two
Name one, This is sentence one., 1, 2
Name two, This is sentence two. Next sentence could have comma, or not., 3, 4
Name three, This is sentence three., 5, 6
Name four and more, This is sentence four. This is an addition to the sentence, 7, 8
Я новичок в программировании C ++ и стараюсь без слишком большого успеха, чтобы использовать GetLine для чтения смешанной линии (то есть, строки и целых чисел), текстовый файл в четыре массива. Строка «Файл»: < /p> [code]One, two, num one, num two Name one, This is sentence one., 1, 2 Name two, This is sentence two. Next sentence could have comma, or not., 3, 4 Name three, This is sentence three., 5, 6 Name four and more, This is sentence four. This is an addition to the sentence, 7, 8 [/code] Будем благодарны за любую помощь. Спасибо... [code]getline(infile, nameArray[index]); getline(infile, nameArrayTwo[index]); getline(infile, nameArrayThree[index]); getline(infile, nameArrayfour[index]); [/code] Но все они дают мне одну и ту же информацию. Он не разбивает строку на четыре отдельные переменные. Спасибо...