Witam, mam problem gdy łącze zmienne wyskakuje mi błąd.
kod:
int plik_istnieje (const char* fileName)
{
FILE* plik;
plik = fopen(fileName, "r");
if ( plik )
{
fclose(plik);
return 1;
}
fclose(plik);
return 0;
}
const char* Path = (const char*)Runtime::InteropServices::Marshal::StringToHGlobalAnsi("C:\program1\").ToPointer( );
if(plik_istnieje(Path+"text.txt") == NULL)
{
MessageBox::Show( "Plik nie istnieje", "Program" , MessageBoxButtons::OK, MessageBoxIcon::Information);
}
ERROR:
1>c:\users\piotrek\documents\visual studio 2010\projects\wersja 1\launcher\Form1.h(627): error C2678: binary '+' : no operator found which takes a left-hand operand of type 'const char *' (or there is no acceptable conversion)
1> could be 'built-in C++ operator+(volatile const System::Object ^, volatile const System::String ^)'
1> or 'built-in C++ operator+(volatile const System::String ^, volatile const System::Object ^)'
1> or 'built-in C++ operator+(volatile const System::String ^, volatile const System::String ^)'
1> while trying to match the argument list '(const char *, System::String ^)'
Proszę o pomoc bo nie wiem jak rozwiązać ten problem.