^M(Clt M) character
From: Venkat (venkat_kp_at_yahoo.com)
Date: 09/20/04
- Next message: Tauno Voipio: "Re: ^M(Clt M) character"
- Previous message: Lew Pitcher: "Re: The history of windows."
- Next in thread: Tauno Voipio: "Re: ^M(Clt M) character"
- Reply: Tauno Voipio: "Re: ^M(Clt M) character"
- Reply: Måns Rullgård: "Re: ^M(Clt M) character"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 20 Sep 2004 11:05:49 +0530
Hi All,
I wrote a simple copy of text file to some other location.
I could see ^(Cltr M) character getting inserted at the end of each line in
the file.
PFB my program(copying test.txt file to TestFile.txt)
std::string TestFile;
TestFile = PATH + test;
FILE *fp1 = fopen(TestFile.c_str(), "wb");
FILE *fp2 = fopen(test.c_str(), "rb");
int Byte1;
if (fp1 == NULL)
{
fprintf(fp, "\n Cannot open destination file %s",
TestFile.c_str());
return -1;
}
if (fp2 == NULL)
{
fprintf(fp, "\n Cannot open source file %s", test.c_str());
return -1;
}
while(Byte1!=EOF)
{
Byte1 = fgetc(fp2);
if(Byte1!=EOF)
fputc(Byte1,fp1);
}
fprintf(fp, "\n Copied Test File to %s location",TestFile.c_str());
fclose(fp2);
fclose(fp1);
Please advice.
regards,
Venkat
- Next message: Tauno Voipio: "Re: ^M(Clt M) character"
- Previous message: Lew Pitcher: "Re: The history of windows."
- Next in thread: Tauno Voipio: "Re: ^M(Clt M) character"
- Reply: Tauno Voipio: "Re: ^M(Clt M) character"
- Reply: Måns Rullgård: "Re: ^M(Clt M) character"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|