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

C / C++ / MFC

 
GeneralRe: MSDN Pin
Mike Nordell23-Apr-02 10:19
Mike Nordell23-Apr-02 10:19 
QuestionHow to pass handle to stl container? Pin
Todd Smith22-Apr-02 15:37
Todd Smith22-Apr-02 15:37 
AnswerRe: How to pass handle to stl container? Pin
Paul M Watt22-Apr-02 15:52
mentorPaul M Watt22-Apr-02 15:52 
GeneralRe: How to pass handle to stl container? Pin
Christian Graus22-Apr-02 16:06
protectorChristian Graus22-Apr-02 16:06 
GeneralSpeeding Up Display Time in CEditView :: MFC Pin
valikac22-Apr-02 15:27
valikac22-Apr-02 15:27 
GeneralRe: Speeding Up Display Time in CEditView :: MFC Pin
Paul M Watt22-Apr-02 16:02
mentorPaul M Watt22-Apr-02 16:02 
GeneralRe: Speeding Up Display Time in CEditView :: MFC Pin
valikac22-Apr-02 16:36
valikac22-Apr-02 16:36 
GeneralRe: Speeding Up Display Time in CEditView :: MFC Pin
Paul M Watt22-Apr-02 18:47
mentorPaul M Watt22-Apr-02 18:47 
You may want to consider storing the lines of your text in a different type of container besides a linked list. The lookup time for a linked list is O(n). Meaning, if you have n lines in your file, in order to lookup the last line of the text you would have to navigate through n objects.

Consider your 60K file. Say that each line is 100 bytes long. That would give you 600 lines. If you want to get to the string on the 600th line, you will have to navigate through all 600 lines to get to the end and access the last line.

A better choice would be a vector, where lookup is O(1), which means you can access any of the lines with one lookup. Memory allocations may become a problem with a vector. So you could also consider a Map, which its underlying representation is a tree (if you are using STL) and the look up time would be O(log(n)). Which still beats O(n) by a long shot.



Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: Speeding Up Display Time in CEditView :: MFC Pin
valikac22-Apr-02 19:13
valikac22-Apr-02 19:13 
GeneralCFormView resizing Pin
22-Apr-02 13:58
suss22-Apr-02 13:58 
GeneralRe: CFormView resizing Pin
Roger Allen22-Apr-02 21:51
Roger Allen22-Apr-02 21:51 
GeneralRe: CFormView resizing Pin
ErrN023-Apr-02 1:12
ErrN023-Apr-02 1:12 
GeneralGet an HICON from a running process Pin
22-Apr-02 13:33
suss22-Apr-02 13:33 
GeneralRe: Get an HICON from a running process Pin
Paul M Watt22-Apr-02 13:48
mentorPaul M Watt22-Apr-02 13:48 
GeneralRe: Get an HICON from a running process Pin
22-Apr-02 16:35
suss22-Apr-02 16:35 
GeneralHigh-speed screen captures Pin
twomagiclovers22-Apr-02 12:37
twomagiclovers22-Apr-02 12:37 
GeneralRe: High-speed screen captures Pin
Christian Graus22-Apr-02 12:41
protectorChristian Graus22-Apr-02 12:41 
GeneralRe: High-speed screen captures Pin
Paul M Watt22-Apr-02 14:00
mentorPaul M Watt22-Apr-02 14:00 
QuestionClass Function? Pin
Loli1022-Apr-02 10:24
Loli1022-Apr-02 10:24 
AnswerRe: Class Function? Pin
Chris Losinger22-Apr-02 10:37
professionalChris Losinger22-Apr-02 10:37 
AnswerRe: Class Function? Pin
Ravi Bhavnani22-Apr-02 11:09
professionalRavi Bhavnani22-Apr-02 11:09 
GeneralRe: Class Function? Pin
24-Apr-02 11:04
suss24-Apr-02 11:04 
GeneralFindFirstFile() Pin
hph22-Apr-02 10:12
hph22-Apr-02 10:12 
GeneralRe: FindFirstFile() Pin
23-Apr-02 0:10
suss23-Apr-02 0:10 
QuestionVC6 and VS.NET installed on the same computer? Pin
Rickard Andersson2022-Apr-02 9:48
Rickard Andersson2022-Apr-02 9:48 

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.