I need to convert the cpp code that I wrote in visual studio 2010 to visual C++ 6.0. However, I am getting errors.
I need to do this as I am designing some sequence for MRI scanner and siemens has only visual C++ 6.0 on the scanner.
I need to do very simple operations. I need to change directory and read two values from .txt file and convert it as double.
Also, it has to run on window as well as linux system as scanner uses both.
#define GetCurrentDir _getcwd
#define GetCurrentDir getcwd
//Finding out the directory
// Get the current working directory:
if( (pwd = _getcwd( NULL, 0 )) == NULL )
perror( "_getcwd error" );
printf( "%s \nLength: %d\n", pwd, strlen(pwd) );
//Conversion from char* to string
//printf ("The current working directory is %s", buffer);
string Filename = PWD + '/' + "example.txt";
cout<<"Verifying that cout works"<<endl;
while(!infile.eof()) // To get you all the lines.
cout<<"works fine here 1"<<endl;
getline(infile,STRING); // Saves the line in STRING.
cout<<"works fine here 2"<<endl;
cout<<STRING<<endl; // Prints our STRING.