Click here to Skip to main content
16,015,414 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Backspace problem in ActiveX embeded in IE Pin
khan++14-Mar-06 19:21
khan++14-Mar-06 19:21 
QuestionFiles Pin
chaitanya2213-Mar-06 22:33
chaitanya2213-Mar-06 22:33 
AnswerRe: Files Pin
Ray Kinsella13-Mar-06 22:36
Ray Kinsella13-Mar-06 22:36 
AnswerRe: Files Pin
kakan13-Mar-06 22:37
professionalkakan13-Mar-06 22:37 
GeneralRe: Files Pin
chaitanya2213-Mar-06 23:19
chaitanya2213-Mar-06 23:19 
GeneralRe: Files Pin
kakan13-Mar-06 23:42
professionalkakan13-Mar-06 23:42 
GeneralRe: Files Pin
chaitanya2214-Mar-06 5:20
chaitanya2214-Mar-06 5:20 
GeneralRe: Files Pin
kakan14-Mar-06 19:20
professionalkakan14-Mar-06 19:20 
Hello chaitanya.

That's much easier. That way, you just append to the file.
Just make sure you put a '\n' character ONLY at the end of line.
Today, you write a '\n' for each value, which gives a newline after each value. That's the reason why you get each value on a separate text line in the file.

I don't know what function you are using for writing to the file today, but i suspect you are using fputc() or fputs(), right?

There are numerous ways to write to a file, this is just one way.

You can to this, using fputc. (I assume FILE * file):

int number = '1';

fputc(number, file);
fputc((int) ' ', file);

number = '2';
fputc(number, file);
fputc((int) ' ', file);

number = '3';
fputc(number, file);
fputc((int) ' ', file);

And the last number:
fputc(number, file);
fputc((int) '\n', file);

Or, if you got all numbers at the same time, you can do this:
fprintf(file, "%d %d %d %d\n", 1,2,3,4);
fprintf(file, "%d %d %d %d\n", 5,6,7,8);

This is very basic knowledge, I think you should read a good beginners book about C and then go on with a book about C++.

Good luck
Kakan
QuestionHELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
chev_ls113-Mar-06 22:28
chev_ls113-Mar-06 22:28 
AnswerRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
Stephen Hewitt13-Mar-06 22:31
Stephen Hewitt13-Mar-06 22:31 
GeneralRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
chev_ls113-Mar-06 22:41
chev_ls113-Mar-06 22:41 
GeneralRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
Stephen Hewitt13-Mar-06 22:45
Stephen Hewitt13-Mar-06 22:45 
GeneralRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
chev_ls113-Mar-06 22:54
chev_ls113-Mar-06 22:54 
GeneralRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
khan++14-Mar-06 2:30
khan++14-Mar-06 2:30 
GeneralRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
David Crow14-Mar-06 3:11
David Crow14-Mar-06 3:11 
AnswerRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
Ray Kinsella13-Mar-06 22:33
Ray Kinsella13-Mar-06 22:33 
GeneralRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
chev_ls113-Mar-06 22:43
chev_ls113-Mar-06 22:43 
AnswerRe: HELP!!!... ODBC CRecordSet based MFC application slowing down to unusable speeds!! :( Pin
Cool Ju13-Mar-06 23:38
Cool Ju13-Mar-06 23:38 
Questiondiff b/w heapalloc and new Pin
sunit513-Mar-06 22:02
sunit513-Mar-06 22:02 
AnswerRe: diff b/w heapalloc and new Pin
Stephen Hewitt13-Mar-06 22:07
Stephen Hewitt13-Mar-06 22:07 
GeneralRe: diff b/w heapalloc and new Pin
sunit513-Mar-06 22:20
sunit513-Mar-06 22:20 
GeneralRe: diff b/w heapalloc and new Pin
Stephen Hewitt13-Mar-06 22:24
Stephen Hewitt13-Mar-06 22:24 
GeneralRe: diff b/w heapalloc and new Pin
sunit513-Mar-06 22:33
sunit513-Mar-06 22:33 
GeneralRe: diff b/w heapalloc and new Pin
Stephen Hewitt13-Mar-06 22:38
Stephen Hewitt13-Mar-06 22:38 
GeneralRe: diff b/w heapalloc and new Pin
sunit513-Mar-06 22:46
sunit513-Mar-06 22:46 

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.