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

C / C++ / MFC

 
AnswerRe: cpuh header is not supported by my compiler .. What should i do to make it support.? Pin
Code-o-mat22-Jan-09 7:12
Code-o-mat22-Jan-09 7:12 
GeneralRe: cpuh header is not supported by my compiler .. What should i do to make it support.? Pin
CPallini22-Jan-09 7:19
mveCPallini22-Jan-09 7:19 
GeneralRe: cpuh header is not supported by my compiler .. What should i do to make it support.? Pin
led mike22-Jan-09 8:37
led mike22-Jan-09 8:37 
GeneralRe: cpuh header is not supported by my compiler .. What should i do to make it support.? Pin
Code-o-mat22-Jan-09 8:40
Code-o-mat22-Jan-09 8:40 
GeneralRe: cpuh header is not supported by my compiler .. What should i do to make it support.? Pin
ssivus23-Jan-09 20:01
ssivus23-Jan-09 20:01 
QuestionDiscrete Derivative with arrays? Pin
LostPitch22-Jan-09 5:34
LostPitch22-Jan-09 5:34 
AnswerRe: Discrete Derivative with arrays? Pin
CPallini22-Jan-09 6:05
mveCPallini22-Jan-09 6:05 
AnswerRe: Discrete Derivative with arrays? Pin
Stuart Dootson22-Jan-09 12:37
professionalStuart Dootson22-Jan-09 12:37 
LostPitch wrote:
I know that allocation for arrays is static


Only when they're allocated on the stack.

What's wrong with allocating the array on the heap:

float* diff(float* inArr, size_t inArrSize)
{
   float* outArr = new float[inArrSize-1];
   for(size_t i=0;i<inarrsize-1;++i)>
   {
      outArr[i] = inArr[i+1]-inArr[i];
   }
   return outArr;
}


Yes, you need to deallocate it after it's been used with delete[], but hey - it works!

Also - what's with the use of float? Doubles have more bits and are also faster, as floating point hardware is double or bigger internally and has performance penalties for converting to and from single precision floating point data.

LostPitch wrote:
I would like to avoid to use vectors


Again - why? vectors (certainly after the TR1 update to the C++ standard) are guaranteed to be as efficient as arrays. They also do all the memory management for you. What's not to like?
JokeRe: Discrete Derivative with arrays? Pin
CPallini22-Jan-09 21:06
mveCPallini22-Jan-09 21:06 
JokeRe: Discrete Derivative with arrays? Pin
Stuart Dootson22-Jan-09 22:57
professionalStuart Dootson22-Jan-09 22:57 
JokeOMG! Pin
CPallini22-Jan-09 23:25
mveCPallini22-Jan-09 23:25 
GeneralRe: OMG! Pin
Stuart Dootson22-Jan-09 23:34
professionalStuart Dootson22-Jan-09 23:34 
GeneralRe: OMG! Pin
SandipG 23-Jan-09 0:14
SandipG 23-Jan-09 0:14 
GeneralRe: OMG! Pin
CPallini23-Jan-09 0:36
mveCPallini23-Jan-09 0:36 
GeneralRe: Discrete Derivative with arrays? Pin
LostPitch24-Jan-09 1:31
LostPitch24-Jan-09 1:31 
QuestionHow to create DialogBox at runtime without adding it into the Resource.rc? Pin
Abhijit D. Babar22-Jan-09 4:22
Abhijit D. Babar22-Jan-09 4:22 
AnswerRe: How to create DialogBox at runtime without adding it into the Resource.rc? Pin
Sarath C22-Jan-09 4:31
Sarath C22-Jan-09 4:31 
AnswerRe: How to create DialogBox at runtime without adding it into the Resource.rc? Pin
Iain Clarke, Warrior Programmer22-Jan-09 5:19
Iain Clarke, Warrior Programmer22-Jan-09 5:19 
GeneralRe: How to create DialogBox at runtime without adding it into the Resource.rc? Pin
Abhijit D. Babar22-Jan-09 22:15
Abhijit D. Babar22-Jan-09 22:15 
GeneralRe: How to create DialogBox at runtime without adding it into the Resource.rc? Pin
Iain Clarke, Warrior Programmer22-Jan-09 22:36
Iain Clarke, Warrior Programmer22-Jan-09 22:36 
GeneralRe: How to create DialogBox at runtime without adding it into the Resource.rc? Pin
Abhijit D. Babar23-Jan-09 0:53
Abhijit D. Babar23-Jan-09 0:53 
Questionconvert System::String to char * Pin
bubuzzz22-Jan-09 3:00
bubuzzz22-Jan-09 3:00 
AnswerRe: convert System::String to char * Pin
Stuart Dootson22-Jan-09 3:37
professionalStuart Dootson22-Jan-09 3:37 
AnswerRe: convert System::String to char * Pin
toxcct22-Jan-09 3:55
toxcct22-Jan-09 3:55 
AnswerRe: convert System::String to char * Pin
Sarath C22-Jan-09 4:34
Sarath C22-Jan-09 4:34 

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.