Alright. So there is a file, filename.dtbf. It contains this: "111122". I want, each
individual digit of that number, to be in a separate int. (a, b, c, d, e, f) resulting in a=1, b=1, c=1, d=1, e=2, f=2. (Likewise, if it was "122121" in filename.dtbf a=1, b=2, c=2, d=1, e=2, f=1).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <cstdlib>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <stdio.h>
#include "functions.h"
using namespace std;
int main{
int a;
int b;
int c;
int d
int e;
int f;
ifstream readFile;
readFile.open("filename.dtbf");
// Here is the Question
}
|
I want a,b,c,d,e,f to all get a separate digit of whatever six digit combination of 1's and 2's there are in filename.dtbf.
BACKSTORY:
This file is generated by the user from the program, setting different variables of how they want to use my program. Then, so the program remembers these settings, it reads the file, and sets the variable to the digits in the file. So, a,b,c,d,e,f can be used in if statements to run different functions the user wants them to be run.