C++ Dynamic Array & Ifstream

I have a question about the problem I'm working on right now. What I'm suppose to do is read text from a txt file into a dynamic array. So what I need to do is read how many chars are in the txt file and set that as my size for my dynamic array. The problem is I'm not sure how to read and count how many chars are in the txt file. Any help would be appreciated. Thanks in advance.
I know how to read from a file, I'm just not sure how to go about reading it into a dynamic array. Also since I have to manipulate the letters would it be easier to put in a char array or string array?
if you need array of int

int *arr

//read the number of elements
arr = new int[Number_of_elements];

for( i= 0; i < number_of_elements; ++i )
cin >> arr[i];

//replace cin with your file stream

//do stuff
delete arr;
arr = NULL; //if using C++11 capable compiler use nullptr instead
Topic archived. No new replies allowed.