#include <iostream>
#include <string>
usingnamespace std;
int main ()
{
constchar a[] = "C:\\Users\\Darth Bane\\Desktop\\Gfx Stuff\\metaknightcopy.bmp";
string b;
cout << "What's your PSP Driver? ";
getline (cin, b);
FILE* in = fopen( a, "rb" ) ;
FILE* out = fopen( b, "wb" ) ;
system("PAUSE");
return 0;
}
And I get this error in line 13
C:\Users\Darth Bane\Desktop\Coder Stuff\Get Person Input.cpp cannot convert `std::string' to `const char*' for argument `1' to `FILE* fopen(const char*, const char*)
I'm not the Best At C++ I'm still learning. And I haven't gotten to fstreams yet. I've almost stopped in the middle of Classes (II) and Polymorphism. So I'm still doing the basics.
And I'm wanting to to go to copy a file to another Driver
Ok and I edited the FILE* in = fopen( a, "rb" ) ;with what you put and I got actually MORE errors. I got
11 C:\Users\Darth Bane\Desktop\Coder Stuff\Get Person Input.cpp request for member `c_str' in `a', which is of non-class type `const char[57]'
And
12 C:\Users\Darth Bane\Desktop\Coder Stuff\Get Person Input.cpp cannot convert `std::string' to `const char*' for argument `1' to `FILE* fopen(const char*, const char*)'
And When I edit the other FILE* out = fopen( b, "wb" ) ; I get the same last error
quote]11 C:\Users\Darth Bane\Desktop\Coder Stuff\Get Person Input.cpp request for member `c_str' in `a', which is of non-class type `const char[57]' [/quote]