I then want to store them into an array
Okay, you've got the reading part down, as your current code already does read correctly.
To store the values into an array:
// (With minimal changes to your code)
char* my_array = new char[limit];
for (int number = 0; number < limit; number++) {
inputFile >> stepc_char;
cout << stepc_char << endl;
my_array[number] = stepc_char;
}
Don't forget to delete[] my_array;
when you're done with it though. The only reason I'm allocating the memory like this instead of doing char my_array[limit];
is because the given array size must be constant. (This is what I can tell from my compiler).
If you don't need the array indefinitely, execute delete[] my_array;
immediately before you exit scope.
For example, if the above code was inside an if block, this is what it should look like:
if (someExpression) {
char* my_array = new char[limit];
for (int number = 0; number < limit; number++) {
inputFile >> stepc_char;
cout << stepc_char << endl;
my_array[number] = stepc_char;
}
// process character array
delete[] my_array;
}