Click here to Skip to main content
16,005,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDisplay a graph / Extend CListView? Pin
26-Apr-02 12:21
suss26-Apr-02 12:21 
QuestionHow to place and drive activex controls in CView Pin
HallerbachJ26-Apr-02 10:33
HallerbachJ26-Apr-02 10:33 
Generalstack corrupted Pin
Steve Severance26-Apr-02 8:26
Steve Severance26-Apr-02 8:26 
GeneralRe: stack corrupted Pin
Paul M Watt26-Apr-02 8:39
mentorPaul M Watt26-Apr-02 8:39 
GeneralRe: stack corrupted Pin
Steve Severance26-Apr-02 11:11
Steve Severance26-Apr-02 11:11 
GeneralRe: stack corrupted Pin
Paul M Watt26-Apr-02 15:46
mentorPaul M Watt26-Apr-02 15:46 
GeneralRe: stack corrupted Pin
Steve Severance28-Apr-02 7:30
Steve Severance28-Apr-02 7:30 
QuestionPointer in a .txt file? Pin
26-Apr-02 7:56
suss26-Apr-02 7:56 
Hi
The following information is in a .txt file. I nead to read through it, pick out certain parts and send the information to a DB.

Memory SM, location 1
Name: John Doe
Number: +12345
Memory SM, location 2
Name: Jane Doe
Number: +54321
Memory SM, location 3
Name: Jack Doe
Number: +112233
...


Here is the code I use to get the info I need from the first 3 lines:

/***********************************************/
FILE *stream;
stream = fopen( "number", "r" );
char bufLine1[30], bufLine2[30], bufLine3[30];

fgets(bufLine1, 30, stream);
fgets(bufLine2, 30, stream);
fgets(bufLine3, 30, stream);

fclose( stream );

char *pNext1 = &bufLine1 [21];
char *pNext2 = &bufLine2 [9];
char *pNext3 = &bufLine3 [11];

strcpy(bufLine1, pNext1);
strcpy(bufLine2, pNext2);
strcpy(bufLine3, pNext3);

//information sent to database
/***********************************************/

Is there a way that I can put this in a loop and then start reading the 4th, 5th & 6th line and send their details off to the DB. And the go on to the 7th, 8th & 9th etc? I persume it's something like a pointer in a text file but I'm not sure how to do this.

Thanks for any help.
Alan

AnswerRe: Pointer in a .txt file? Pin
Albert Pascual26-Apr-02 8:55
sitebuilderAlbert Pascual26-Apr-02 8:55 
AnswerRe: Pointer in a .txt file? Pin
wangyiming26-Apr-02 22:15
wangyiming26-Apr-02 22:15 
QuestionAn memory management problem ? Pin
yarp26-Apr-02 7:13
yarp26-Apr-02 7:13 
AnswerRe: An memory management problem ? Pin
Paul M Watt26-Apr-02 7:42
mentorPaul M Watt26-Apr-02 7:42 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 8:06
yarp26-Apr-02 8:06 
GeneralRe: An memory management problem ? Pin
Paul M Watt26-Apr-02 8:12
mentorPaul M Watt26-Apr-02 8:12 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 8:18
yarp26-Apr-02 8:18 
GeneralRe: An memory management problem ? Pin
Paul M Watt26-Apr-02 8:32
mentorPaul M Watt26-Apr-02 8:32 
GeneralRe: An memory management problem ? Pin
Tim Smith26-Apr-02 9:04
Tim Smith26-Apr-02 9:04 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 9:27
yarp26-Apr-02 9:27 
GeneralRe: An memory management problem ? Pin
Tim Smith26-Apr-02 10:00
Tim Smith26-Apr-02 10:00 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 10:27
yarp26-Apr-02 10:27 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 12:14
yarp26-Apr-02 12:14 
GeneralRe: An memory management problem ? Pin
Tim Smith26-Apr-02 14:27
Tim Smith26-Apr-02 14:27 
GeneralRe: An memory management problem ? Pin
yarp26-Apr-02 19:11
yarp26-Apr-02 19:11 
GeneralDisplaying a bitmap without a windows frame. Pin
Del26-Apr-02 6:27
Del26-Apr-02 6:27 
GeneralRe: Displaying a bitmap without a windows frame. Pin
Carlos Antollini26-Apr-02 6:55
Carlos Antollini26-Apr-02 6:55 

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.