Passing a character array to ifstream

I have a sequence of data files (Site_1.txt, Site_2.txt,.....,Site_N.txt) that i need to read into my main program. Although I managed to construct the file names (as character arrays using sprintf), I am not sure of how to pass them to the ifstream, as it needs the file names to be of string type.

Hi Duoas,
Is "string" a defined datatype in vc++? Because, whenever I type the word "string", the vc++ editor does not highlight it (whereas int, char gets highlighted). The code below throws up two error messages..

I always mix up the stream constructors. Your first post complained that the ifstream required a string, so I took that as right. But that's backwards. The ifstream constructor requires your filename to be a char*. So... use: ifstream ifData( filename.c_str() ); If that doesn't fix your 'system' problem, show me every place in your code where you use the word 'system'. If there isn't any, there is some other problem... alas.

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...