Click here to Skip to main content
15,911,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Help with GridCtrl bounds checking Pin
Chris Maunder8-Jun-00 14:39
cofounderChris Maunder8-Jun-00 14:39 
GeneralRe: Help with GridCtrl bounds checking Pin
Joseph9-Jun-00 3:22
Joseph9-Jun-00 3:22 
GeneralFast algorithm for padding nulls into a string Pin
Matthias8-Jun-00 1:33
Matthias8-Jun-00 1:33 
GeneralRe: Fast algorithm for padding nulls into a string Pin
Uwe Keim8-Jun-00 1:56
sitebuilderUwe Keim8-Jun-00 1:56 
GeneralRe: Fast algorithm for padding nulls into a string Pin
Matthias8-Jun-00 2:23
Matthias8-Jun-00 2:23 
GeneralRe: Fast algorithm for padding nulls into a string Pin
Paolo Messina8-Jun-00 4:09
professionalPaolo Messina8-Jun-00 4:09 
GeneralRe: Fast algorithm for padding nulls into a string Pin
Sam Hobbs8-Jun-00 10:01
Sam Hobbs8-Jun-00 10:01 
GeneralRe: Fast algorithm for padding nulls into a string Pin
Blake Miller9-Jun-00 4:59
Blake Miller9-Jun-00 4:59 
I did some brief testing using a debug build.

I discovered that the Sprintf() took about 4100 ticks (difference between GetTickCount() calls before and after for loop) to do 1 million iterations.

Using a technique similar to what was described in other replies took about 1500 ticks.

Here is code snippet of faster technique.

// preset to required zero characters
memset(szBuffer, 48, 6);
// convert your number to ascii string
_itoa(iValue, szValue, 10);
// get length of string
iLength = lstrlen(szValue);
// copy value into zero buffered string
// starting at correct offset to leave leading zeroes
lstrcpy(&szBuffer[6 - iLength], szValue);

If you inlined the source for each of the functions, it would be even faster.

GeneralPacket Capturing Pin
Member 26197-Jun-00 21:55
Member 26197-Jun-00 21:55 
GeneralStruct from one class to another Pin
Claude Gagnon7-Jun-00 17:16
Claude Gagnon7-Jun-00 17:16 
GeneralRe: Struct from one class to another Pin
Amit B7-Jun-00 19:05
Amit B7-Jun-00 19:05 
GeneralRe: Struct from one class to another Pin
Uwe Keim8-Jun-00 11:49
sitebuilderUwe Keim8-Jun-00 11:49 
GeneralUsing STL in ATL Pin
Tony Li7-Jun-00 10:55
Tony Li7-Jun-00 10:55 
GeneralRe: Using STL in ATL Pin
Tim Deveaux7-Jun-00 11:32
Tim Deveaux7-Jun-00 11:32 
GeneralRe: Using STL in ATL Pin
Tony Li7-Jun-00 12:07
Tony Li7-Jun-00 12:07 
GeneralRe: Using STL in ATL Pin
Alex Gorev8-Jun-00 8:16
Alex Gorev8-Jun-00 8:16 
GeneralAccess replication/synchronization using CDaoDatabase Pin
W Dicks7-Jun-00 7:28
W Dicks7-Jun-00 7:28 
GeneralLPARAM associated data in TVITEM in TreeCtrl Pin
Member 103121487-Jun-00 6:25
Member 103121487-Jun-00 6:25 
GeneralRe: LPARAM associated data in TVITEM in TreeCtrl Pin
Uwe Keim7-Jun-00 10:45
sitebuilderUwe Keim7-Jun-00 10:45 
GeneralRe: LPARAM associated data in TVITEM in TreeCtrl Pin
michael7-Jun-00 14:52
michael7-Jun-00 14:52 
GeneralRe: LPARAM associated data in TVITEM in TreeCtrl Pin
michael8-Jun-00 2:20
michael8-Jun-00 2:20 
GeneralProblems serializing data structures (2) Pin
JCpp6-Jun-00 22:24
JCpp6-Jun-00 22:24 
QuestionHow to display Video in a Window? Pin
RickL6-Jun-00 19:41
RickL6-Jun-00 19:41 
AnswerRe: How to display Video in a Window? Pin
Amit B7-Jun-00 19:00
Amit B7-Jun-00 19:00 
AnswerRe: How to display Video in a Window? Pin
9-May-01 2:09
suss9-May-01 2:09 

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.