I want to read from a file only the variables that matter, for example I have a contacts.txt
and it says something like:
Name Penelope Pasaft Cel 1535363236
and the only things I want to read or save at memory at specific variables for example the variable name
and cel
are the data that really matters.
In this case, I want to save Penelope Pasaft
to the variable name and the specific number given to the variable cel
.
In C, I used to use something like scanf("Name %s",name)
but in C++, I don't know if there is something like that or how to do it!