Originally Posted by
JHaney
I know how to open the file and I know how to output a data file but I'm not sure how to read from the file. I know I need to use get() I think but I'm not sure how to get char array set up to read the paragraph.
Don't use a char array to read the file. Instead, read the data into a char variable. Then, use a char array to store the converted characters. A char array works just like a numerical array, and it can be used to hold values just like a numerical array can--the only difference is that the values the char array holds are char's rather than numbers. Here is an example:
Code:
#include <iostream>
using namespace std;
int main()
{
char input = 'a';
char converted[100] = {0};
converted[0] = input;
input = 'b';
converted[1] = input;
input = 'c';
converted[2] = input;
cout<<converted<<endl;
return 0;
}