Click here to Skip to main content
16,010,394 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Multiple Definition error Pin
XTAL25615-Apr-07 1:54
XTAL25615-Apr-07 1:54 
Questionmost efficient way to code this Pin
arbster114-Apr-07 15:47
arbster114-Apr-07 15:47 
AnswerRe: most efficient way to code this Pin
John R. Shaw14-Apr-07 16:14
John R. Shaw14-Apr-07 16:14 
AnswerRe: most efficient way to code this Pin
bob1697214-Apr-07 16:44
bob1697214-Apr-07 16:44 
GeneralRe: most efficient way to code this Pin
arbster114-Apr-07 16:52
arbster114-Apr-07 16:52 
GeneralRe: most efficient way to code this Pin
bob1697214-Apr-07 17:29
bob1697214-Apr-07 17:29 
GeneralRe: most efficient way to code this Pin
arbster114-Apr-07 17:59
arbster114-Apr-07 17:59 
GeneralRe: most efficient way to code this Pin
bob1697214-Apr-07 19:54
bob1697214-Apr-07 19:54 
I see nothing that would contribute to a noticeable increase in the time it takes to process a line of text. An optimizing compiler would catch and eliminate the few redundant instructions I see.

I'm more familiar with MFC's CString than basic_string or string. CString will not create a new copy of the string when passed into a function by value unless the function modifies the string. I'm not sure if basic_string or string have this ability. If not, you may save a few clock ticks by passing it in by reference but I'm guessing you won't notice or perceive any time savings but it's worth a try...

int get_cols(int (&pos)[50],const string& line){


The only unrelated things worth mentioning are...

the line x=loc=0; is not needed since they go out of scope right afterwards anyway and the function always returns the same value which raises the question whether a return value should even be defined for the function. I would return the column count so the caller could detect an error (i.e. too many columns or fewer than expected)

How long does it take to process a 90,000 line file for you? You may have issues elsewhere in the code if the time is excessive.


GeneralRe: most efficient way to code this Pin
kakan15-Apr-07 19:27
professionalkakan15-Apr-07 19:27 
Questionlpvoid and structs Pin
ginjikun14-Apr-07 15:14
ginjikun14-Apr-07 15:14 
AnswerRe: lpvoid and structs Pin
John R. Shaw14-Apr-07 16:21
John R. Shaw14-Apr-07 16:21 
AnswerRe: lpvoid and structs Pin
John R. Shaw14-Apr-07 16:25
John R. Shaw14-Apr-07 16:25 
AnswerRe: lpvoid and structs Pin
d34studios14-Apr-07 16:46
d34studios14-Apr-07 16:46 
GeneralRe: lpvoid and structs Pin
ginjikun15-Apr-07 3:16
ginjikun15-Apr-07 3:16 
GeneralRe: lpvoid and structs Pin
Mark Salsbery15-Apr-07 13:56
Mark Salsbery15-Apr-07 13:56 
QuestionProblem of using selectSingleNode! [modified] Pin
Nothend14-Apr-07 15:11
Nothend14-Apr-07 15:11 
AnswerRe: Problem of using selectSingleNode! Pin
George L. Jackson14-Apr-07 15:27
George L. Jackson14-Apr-07 15:27 
GeneralRe: Problem of using selectSingleNode! Pin
Nothend14-Apr-07 15:40
Nothend14-Apr-07 15:40 
GeneralRe: Problem of using selectSingleNode! Pin
George L. Jackson14-Apr-07 15:58
George L. Jackson14-Apr-07 15:58 
GeneralRe: Problem of using selectSingleNode! Pin
Nothend14-Apr-07 16:13
Nothend14-Apr-07 16:13 
GeneralRe: Problem of using selectSingleNode! Pin
Nothend14-Apr-07 16:54
Nothend14-Apr-07 16:54 
GeneralRe: Problem of using selectSingleNode! [modified] Pin
George L. Jackson14-Apr-07 17:09
George L. Jackson14-Apr-07 17:09 
GeneralRe: Problem of using selectSingleNode! Pin
Nothend14-Apr-07 18:04
Nothend14-Apr-07 18:04 
GeneralRe: Problem of using selectSingleNode! Pin
George L. Jackson14-Apr-07 17:14
George L. Jackson14-Apr-07 17:14 
Questionerror C3861: 'GetCurrentThreadID': identifier not found Pin
glyfyx14-Apr-07 11:01
glyfyx14-Apr-07 11:01 

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.