Click here to Skip to main content
15,914,225 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reading a text file Pin
David Crow6-Jul-05 8:30
David Crow6-Jul-05 8:30 
GeneralRe: Reading a text file Pin
Andrew Admire6-Jul-05 8:35
Andrew Admire6-Jul-05 8:35 
GeneralRe: Reading a text file Pin
David Crow6-Jul-05 9:31
David Crow6-Jul-05 9:31 
GeneralRe: Reading a text file Pin
Andrew Admire6-Jul-05 9:41
Andrew Admire6-Jul-05 9:41 
GeneralRe: Reading a text file Pin
David Crow6-Jul-05 11:03
David Crow6-Jul-05 11:03 
GeneralRe: Reading a text file Pin
Anonymous6-Jul-05 19:33
Anonymous6-Jul-05 19:33 
GeneralRe: Reading a text file Pin
David Crow7-Jul-05 2:29
David Crow7-Jul-05 2:29 
GeneralRe: Reading a text file Pin
cgb1436-Jul-05 15:05
cgb1436-Jul-05 15:05 
this needs a lot of polish, but it does the bare essentials.
in_filename and out_filename could be selected using CFileDialog. they are hard coded here.

#include windows.h
#include string.h
#include stdio.h

main()
{
FILE *infile_p; // pointer for read file
FILE *outfile_p; // pointer for write file
int byte;// var for byte read from file

if ((infile_p = fopen("in_filename", "r"))==NULL) // open file for read
{
exit(0);
}
if ((outfile_p = fopen("out_filename", "w"))==NULL) // open file for write
{
exit(0);
}

while (!feof(infile_p)) // end of file test
{
byte = (fgetc(infile_p));
if (byte == 32) // look for a space
{
fprintf(outfile_p ,"%c%c", 0x0d, 0x0a);/ replace it with CR/LF
}
else
{
fprintf( outfile_p, "%c", byte);
}
}

return(0);
}
GeneralRe: Reading a text file Pin
Anonymous8-Jul-05 6:07
Anonymous8-Jul-05 6:07 
GeneralRe: Reading a text file Pin
beerboy_227-Jul-05 14:23
beerboy_227-Jul-05 14:23 
GeneralATL MFC troubles Pin
Bob Stanneveld6-Jul-05 5:07
Bob Stanneveld6-Jul-05 5:07 
GeneralRe: ATL MFC troubles Pin
Bob Stanneveld6-Jul-05 5:56
Bob Stanneveld6-Jul-05 5:56 
GeneralRe: ATL MFC troubles Pin
David Crow6-Jul-05 6:23
David Crow6-Jul-05 6:23 
GeneralRe: ATL MFC troubles Pin
Bob Stanneveld6-Jul-05 20:29
Bob Stanneveld6-Jul-05 20:29 
Generalmemory allocation Pin
Martial Spirit6-Jul-05 4:33
Martial Spirit6-Jul-05 4:33 
GeneralRe: memory allocation Pin
David Crow6-Jul-05 5:06
David Crow6-Jul-05 5:06 
GeneralRe: memory allocation Pin
Martial Spirit6-Jul-05 6:48
Martial Spirit6-Jul-05 6:48 
QuestionHow to call a VBScript function from an ActiveX (in VC++6) Pin
thanh-hai.bui6-Jul-05 4:09
thanh-hai.bui6-Jul-05 4:09 
AnswerRe: How to call a VBScript function from an ActiveX (in VC++6) Pin
David Crow6-Jul-05 4:18
David Crow6-Jul-05 4:18 
GeneralRe: How to call a VBScript function from an ActiveX (in VC++6) Pin
thanh-hai.bui6-Jul-05 4:34
thanh-hai.bui6-Jul-05 4:34 
GeneralRe: How to call a VBScript function from an ActiveX (in VC++6) Pin
David Crow6-Jul-05 4:56
David Crow6-Jul-05 4:56 
GeneralRe: How to call a VBScript function from an ActiveX (in VC++6) Pin
thanh-hai.bui6-Jul-05 5:27
thanh-hai.bui6-Jul-05 5:27 
GeneralUpdating Data from Multiple tables in C++ Database Programming Pin
Wisdom20046-Jul-05 3:19
Wisdom20046-Jul-05 3:19 
GeneralRe: Updating Data from Multiple tables in C++ Database Programming Pin
David Crow6-Jul-05 3:40
David Crow6-Jul-05 3:40 
GeneralXML Driver Pin
abhijeet_contact6-Jul-05 2:41
abhijeet_contact6-Jul-05 2:41 

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.