My text file contents are in the form "00101010111101101011".
I want to read it from the file and send each digit to an array,unfortunately i'm only able to use char while reading a file.How do i send each digit onto an array?a
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
char st[32];
int y[32]={0},n=0;
int fstd=0;
ifstream std;
std.open("std.txt");
if(std.is_open())
{
std.seekg(0, ios::end );
fstd = std.tellg();
}
std.read(st,fstd);
std >> st[n];
n++;
std.close();
cout <<endl;
for(int i=0;i<=fstd;i++){
y= (unsigned char) st[i];
cout << st[i] << " ";
}
cin.get();
return 0;
}