Is there any way to get a line from a file and turn it into an int?
like:
ifstream.getline(int);
Is there any way to get a line from a file and turn it into an int?
like:
ifstream.getline(int);
#include <stdio.h>
...
fscanf(filepointer,"%d",&integer);
He used the c-style stream method. If it is an int, why not just do
Code:int variable; ifstream input("file.txt"); input>>variable;
Because i want to read one of the lines from the file not the whole file.