E
E
Elnurhan2020-05-19 01:27:43
C++ / C#
Elnurhan, 2020-05-19 01:27:43

How to read numbers from a file?

Let's say I have a file "name.txt" and inside it are two lines:

10
1 2 4 1 2 5 2 12 51

How to split the numbers, on the second line, by spaces and put them into an integer array?
The number of digits on the second line is not constant.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Demidko, 2020-05-19
@Elnurhan

std::stringstream

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question