S1 FA17-bcs-151
S1 FA17-bcs-151
h>
#include<stdlib.h>
//#include<conio.h>
#include <fstream>
#include <iostream>
int main()
{
char b1[4096];
char b2[4096];
char b3[4096];
ifstream obj;
obj.open("sampletext.txt");
int count = 0, c;
int starting = 0;
int ending = 0;
int previousBuffer = 1;
int totalTokensInFile = 0;
int totalTokensInBuffer1 = 0;
if (curr_buff == b1)
{
curr_buff = b2;
previousBuffer = 1;
ending = 0;
cout << endl << endl << endl << "buffer changed 1" << endl << endl
<< endl;
}
else if (curr_buff == b2)
{
curr_buff = b3;
previousBuffer = 2;
ending = 0;
cout << endl << endl << endl << "buffer changed 2" << endl << endl
<< endl;
}
else if (curr_buff == b3)
{
curr_buff = b1;
previousBuffer = 3;
ending = 0;
cout << endl << endl << endl << "buffer changed 3" << endl << endl
<< endl;
}
obj.get(curr_buff, 4096, EOF);
count = 0;
}
}