Click here to Skip to main content
15,906,626 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Repainting of dialog box takes time. Pin
Eugen Podsypalnikov9-Mar-10 0:40
Eugen Podsypalnikov9-Mar-10 0:40 
GeneralRe: Repainting of dialog box takes time. Pin
Le@rner9-Mar-10 0:42
Le@rner9-Mar-10 0:42 
GeneralRe: Repainting of dialog box takes time. Pin
Eugen Podsypalnikov9-Mar-10 0:56
Eugen Podsypalnikov9-Mar-10 0:56 
GeneralRe: Repainting of dialog box takes time. Pin
Le@rner9-Mar-10 1:01
Le@rner9-Mar-10 1:01 
GeneralRe: Repainting of dialog box takes time. Pin
Eugen Podsypalnikov9-Mar-10 1:05
Eugen Podsypalnikov9-Mar-10 1:05 
GeneralRe: Repainting of dialog box takes time. Pin
Le@rner9-Mar-10 1:41
Le@rner9-Mar-10 1:41 
QuestionHow to allocate memory for 2-D integer array in one line? Pin
Nilesh Hamane8-Mar-10 18:35
Nilesh Hamane8-Mar-10 18:35 
AnswerRe: How to allocate memory for 2-D integer array in one line? Pin
Avi Berger8-Mar-10 19:23
Avi Berger8-Mar-10 19:23 
Confused | :confused:
Nilesh Hamane wrote:
How can i optimize this code in one line?


It is unclear to me what your are asking here. Do you mean by using just one dynamic memory allocation? What aspect of the situation are you trying to optimize - code size or speed; initial setup or use?

I am presuming that you are using C and not C++.

There are a variety of options that you can use. If this is really critical for your application, you will probably have to run some tests to see what is best in your situation.

A second possible approach is to do one allocation of col * row ints and explicitly calculate the offset into this array for each access.

A third approach is to keep your first allocation of row pointers to int, supplement it by a second allocation of col * row ints and set each row pointer to a subsequent group of col ints in the second block.
Please do not read this signature.

GeneralRe: How to allocate memory for 2-D integer array in one line? Pin
Cool_Dev8-Mar-10 19:59
Cool_Dev8-Mar-10 19:59 
QuestionRe: How to allocate memory for 2-D integer array in one line? Pin
CPallini8-Mar-10 20:50
mveCPallini8-Mar-10 20:50 
AnswerRe: How to allocate memory for 2-D integer array in one line? Pin
Eugen Podsypalnikov8-Mar-10 20:54
Eugen Podsypalnikov8-Mar-10 20:54 
AnswerRe: How to allocate memory for 2-D integer array in one line? Pin
LunaticFringe9-Mar-10 3:18
LunaticFringe9-Mar-10 3:18 
GeneralRe: How to allocate memory for 2-D integer array in one line? Pin
Nilesh Hamane26-Jan-11 22:34
Nilesh Hamane26-Jan-11 22:34 
Questionrandom numbers Pin
MsmVc8-Mar-10 18:22
MsmVc8-Mar-10 18:22 
AnswerRe: random numbers Pin
Rajesh R Subramanian8-Mar-10 18:31
professionalRajesh R Subramanian8-Mar-10 18:31 
GeneralRe: random numbers Pin
MsmVc8-Mar-10 18:49
MsmVc8-Mar-10 18:49 
GeneralRe: random numbers Pin
Rajesh R Subramanian8-Mar-10 19:00
professionalRajesh R Subramanian8-Mar-10 19:00 
GeneralRe: random numbers Pin
MsmVc8-Mar-10 19:16
MsmVc8-Mar-10 19:16 
GeneralRe: random numbers [modified] Pin
Cool_Dev8-Mar-10 19:18
Cool_Dev8-Mar-10 19:18 
GeneralRe: random numbers Pin
MsmVc8-Mar-10 22:09
MsmVc8-Mar-10 22:09 
GeneralRe: random numbers Pin
CPallini8-Mar-10 20:46
mveCPallini8-Mar-10 20:46 
AnswerRe: random numbers Pin
David Crow9-Mar-10 2:19
David Crow9-Mar-10 2:19 
QuestionFailed to Update system registry Pin
Pryabu8-Mar-10 17:54
Pryabu8-Mar-10 17:54 
AnswerRe: Failed to Update system registry Pin
22491715-Mar-10 14:07
22491715-Mar-10 14:07 
QuestionStruct Prob Pin
Herboren8-Mar-10 15:14
Herboren8-Mar-10 15:14 

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.