caute. potreboval by som funckiu ktora prida text do suboru bez toho, aby zmazala predosly obsah suboru
skusil som vac funkcii napr. cez
fstream datafile;
datafile.open("C:\launch.ini",fstream::ate);
datafile.open("C:\launch.ini",ios::ate);
datafile.open("C:\launch.ini",ios_base::ate);
ani jeden nefungoval (kompilovat to slo), teraz pouzivamint new_write (char * txt)
{
return 1;
FILE * pFile;
pFile = fopen ("C:\launch.ini","a");
if (pFile!=NULL)
{
fputs (txt,pFile);
fclose (pFile);
return 0;
}
}
no na riadku s if ( (new_write(* nsubor)==0) && (new_write(* ncas)==0) ) cout << "Saved";
vypisuje
invalid conversion from `char' to `char*'
initializing argument 1 of `int new_write(char*)'
premenne robim cez char *nsubor = new char[255];
vypisuje to 'nsubor' undeclared (first use this function) ako to mam deklarovat ked sa to deklaruje same vyssie v main()?
este to vypisuje [Warning] unknown escape sequence '\l' na riadkoch s nazvom soboru (C:\launcher) ale hadam to nevadi.