F
Francesco Zavatarelli
I downloaded a free c-compiler and I'm trying to access a file in a windows
directory c:\program files\... but I get an error when I run the code.
Probably my declaration char* NAME is wrong. Anybody can give a suggestion?
Thanks very much.
Fzavat
char* NAME_SMS = "c:\\Program Files\\Palm\\Tungst\\Backup\\SmsDB.PDB";
file_sms = fopen(NAME_SMS, "r");
if (file_sms == NULL) {
fprintf(stdout, "Error opening file.\n");
}
fclose(file_sms);
When I run the code I get the "Error opening file." message. If I try with
char* NAME_SMS = "c:\Program Files\Palm\Tungst\Backup\SmsDB.PDB"; I get a
compiler error: lexical: unknown escape sequence `\P'
directory c:\program files\... but I get an error when I run the code.
Probably my declaration char* NAME is wrong. Anybody can give a suggestion?
Thanks very much.
Fzavat
char* NAME_SMS = "c:\\Program Files\\Palm\\Tungst\\Backup\\SmsDB.PDB";
file_sms = fopen(NAME_SMS, "r");
if (file_sms == NULL) {
fprintf(stdout, "Error opening file.\n");
}
fclose(file_sms);
When I run the code I get the "Error opening file." message. If I try with
char* NAME_SMS = "c:\Program Files\Palm\Tungst\Backup\SmsDB.PDB"; I get a
compiler error: lexical: unknown escape sequence `\P'