ok so I have three numbers in a file called input.dat and im able to call them but I want to know how to get those three numbers in that function and able to use them in other functions.
#include <stdio.h>
#include <iostream>
int main(int argc, char * argv[]){
int x = 0;
FILE * pFile;
pFile = fopen("numbers.txt", "r");
if (pFile){
fscanf(pFile, "%d+", &x);
fclose(pFile);
std::cout << x << std::endl;//yes I could have used printf, but again, yolo
//printf("%d", x);
}
}
output
>> 1
You could use what your os provided(like windows (win32) filesysteming thingy magigy)