Click here to Skip to main content
15,896,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Please Help me any body......... Pin
Hamid_RT17-Sep-08 8:26
Hamid_RT17-Sep-08 8:26 
JokeRe: Please Help me any body......... Pin
CPallini17-Sep-08 10:14
mveCPallini17-Sep-08 10:14 
AnswerRe: Please Help me any body......... Pin
Mark Salsbery17-Sep-08 6:19
Mark Salsbery17-Sep-08 6:19 
GeneralRe: Please Help me any body......... Pin
CPallini17-Sep-08 10:17
mveCPallini17-Sep-08 10:17 
GeneralRe: Please Help me any body......... Pin
Mark Salsbery17-Sep-08 10:25
Mark Salsbery17-Sep-08 10:25 
AnswerRe: Please Help me any body......... Pin
Hamid_RT17-Sep-08 8:30
Hamid_RT17-Sep-08 8:30 
QuestionNotifying Parent Dialog about the child control changes Pin
Vikas_12317-Sep-08 1:46
Vikas_12317-Sep-08 1:46 
Questioncopy content 2 file.txt ==> output.txt Pin
aa_zz17-Sep-08 1:12
aa_zz17-Sep-08 1:12 
char* t1 = "C:\\a.txt";
char* t2 = "C:\\b.txt";
char* t3 = "c:\\c.txt";

(VC++6.0)please guide I copy content of 2 a and b to c ???. thanks very much

I coded ERROR. open binary ==> it will read \r\n ==>error

e.g:
file a.txt
ABCDED
file b.txt
DDDDDDDDD
file c.txt. ==>>
ABCDED
DDDDDDDDD



content coded

bool copyFile (const char SRC[], const char INPUT2[], const char DEST[])
{
std::ifstream src; // the source file
std::ifstream input2;
std::ofstream dest; // the destination file
src.open (SRC, std::ios::binary); // open in binary to prevent jargon at the end of the buffer
input2.open(INPUT2, std::ios::binary);
dest.open (DEST);//, std::ios::binary); // same again, binary

if (!src.is_open() || !dest.is_open())
return false; // could not be copied
dest << src.rdbuf (); // copy the content
dest << input2.rdbuf();

dest.close (); // close destination file
src.close (); // close source file

return true; // file copied successfully
}

int main(int argc, char* argv[])
{

if (!copyFile ("C:\\n\\po7.txt", "C:\\n\\po8.txt", "C:\\npo8888.txt"))
std::cout << "File could not be copied successfully";
else
std::cout << "File copied successfully!";

std::cin.get (); // pause for input

return 0;
}
AnswerRe: copy content 2 file.txt ==&gt; output.txt Pin
enhzflep17-Sep-08 2:45
enhzflep17-Sep-08 2:45 
QuestionString Convert Pin
si_6917-Sep-08 0:53
si_6917-Sep-08 0:53 
AnswerRe: String Convert Pin
toxcct17-Sep-08 0:59
toxcct17-Sep-08 0:59 
GeneralRe: String Convert Pin
CPallini17-Sep-08 2:58
mveCPallini17-Sep-08 2:58 
GeneralRe: String Convert Pin
toxcct17-Sep-08 3:05
toxcct17-Sep-08 3:05 
GeneralRe: String Convert Pin
PJ Arends17-Sep-08 9:53
professionalPJ Arends17-Sep-08 9:53 
GeneralRe: String Convert Pin
toxcct17-Sep-08 9:59
toxcct17-Sep-08 9:59 
GeneralRe: String Convert Pin
PJ Arends17-Sep-08 10:08
professionalPJ Arends17-Sep-08 10:08 
JokeRe: String Convert Pin
toxcct17-Sep-08 10:15
toxcct17-Sep-08 10:15 
AnswerRe: String Convert Pin
Hamid_RT17-Sep-08 8:25
Hamid_RT17-Sep-08 8:25 
QuestionInclude file Pin
Tomas(cz)17-Sep-08 0:46
Tomas(cz)17-Sep-08 0:46 
AnswerRe: Include file Pin
Cedric Moonen17-Sep-08 0:50
Cedric Moonen17-Sep-08 0:50 
AnswerRe: Include file Pin
Matthew Faithfull17-Sep-08 1:05
Matthew Faithfull17-Sep-08 1:05 
QuestionGDI+ code doesn't work as expected Pin
followait17-Sep-08 0:36
followait17-Sep-08 0:36 
Questiontypedef with multiple type-declarations Pin
DaveyM6917-Sep-08 0:30
professionalDaveyM6917-Sep-08 0:30 
AnswerRe: typedef with multiple type-declarations Pin
Cedric Moonen17-Sep-08 0:44
Cedric Moonen17-Sep-08 0:44 
GeneralRe: typedef with multiple type-declarations Pin
DaveyM6917-Sep-08 1:02
professionalDaveyM6917-Sep-08 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.