string declaration gets Bad Ptr

I have some code here which seems simple enough, but when debugging, I kept getting <Bad Ptr> and CXX0030: Error: expression cannot be evaluated

Here are the details:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CWinApp theApp;
using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]){
	int nRetCode = 0;

	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0)){
		_tprintf(_T("Fatal Error: MFC initialization failed\n"));
		nRetCode = 1;
	}
	else{
		fstream listfile;
		string m_list, m_source, m_dest;
		char eachline[300];

		cout << "Enter file list location:\n";
		cin >> m_list; //breakpoint here
		cout << "\n";
		...


At the breakpoint I have
m_list - some gibberish
m_source - <Bad Ptr> CXX0030: Error: expression cannot be evaluated
m_dest - <Bad Ptr> CXX0030: Error: expression cannot be evaluated

Input this string for the cin: D:\lmm200\1.txt
and my m_list becomes <Bad Ptr> CXX0030: Error: expression cannot be evaluated
with _Buf 0x0012fde4 "mm200\1.txt" char [16]

I'm using VC++2005.
Could anybody tell me why it isn't inputting the string properly?
make sure your build configuration is set to 'debug'
Topic archived. No new replies allowed.