string to character problem--maybe?

From: Darrell (
Date: 02/09/05

Date: Tue, 8 Feb 2005 23:43:17 -0800

I need to open a number of files. I want to be able to change the
name of the file in the program.

#include "stdafx.h"

#using <mscorlib.dll>
using namespace std;
int _tmain()
 string filename;
 string cc[8031];

 // *********** Open Input File

// I want to be able to replace aapl.csv with ibm.csv dal.csv etc.
//I do this by reading the names from a file
// I have already created.

 filename = "c:\\stkdata\\aapl.csv";
 ifstream file_in;

// If I use this line, the program runs"c:\\stkdata\\aapl.csv");

//If I us this line, the program aborts;

//I want to be able to change filename on the fly

// this is the error message I get
//readtxt.cpp(25): error C2664:
 'void std::basic_ifstream<_Elem
,_Traits>::open(const char *,std::_Iosb<_Dummy>::openmode,int)'
 : cannot convert parameter 1 from 'std::string' to 'const char *'

// with
// [
// _Traits=std::char_traits<char>,
// _Dummy=int
// ]

//Any suggestions greatly appreciated