michaelkrauklis
Programmer
I'm trying to do some text file input but I keep getting an error when I run my program. I set up a very simple program to see if it was something in the rest of my project that was screwing things up, but I get the same error:
The instruction "0x0040f13e" referenced memory at "0xcccccccc". The memory could not be "written".
When I debug it fails inside the iostream class. Here is the code. Very simple and straightforward:
// tmp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
ifstream in("D:\\paradoxTest\\txt\\Employee.txt", ios::in );
if( !in ){
cout<<"something's broken";
exit( 1 );
}
char *temp;
while(in>>temp){
cout<<temp<<endl;
}
return 0;
}
//**********************************
Now I know it's opening the file because if I change the file name it fails like it should. Has anyone else encountered this error? Is it specific to VC++? Because I've done file input in C++ before without any problems. And this is just a simple console application so I don't think there should be any visual component interfering... Any advice would be great. thanks MYenigmaSELF
myenigmaself@yahoo.com
The instruction "0x0040f13e" referenced memory at "0xcccccccc". The memory could not be "written".
When I debug it fails inside the iostream class. Here is the code. Very simple and straightforward:
// tmp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <fstream.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
ifstream in("D:\\paradoxTest\\txt\\Employee.txt", ios::in );
if( !in ){
cout<<"something's broken";
exit( 1 );
}
char *temp;
while(in>>temp){
cout<<temp<<endl;
}
return 0;
}
//**********************************
Now I know it's opening the file because if I change the file name it fails like it should. Has anyone else encountered this error? Is it specific to VC++? Because I've done file input in C++ before without any problems. And this is just a simple console application so I don't think there should be any visual component interfering... Any advice would be great. thanks MYenigmaSELF
myenigmaself@yahoo.com