Click here to Skip to main content
16,005,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questioncpuh header is not supported by my compiler .. What should i do to make it support.? Pin
ssivus22-Jan-09 5:47
ssivus22-Jan-09 5:47 
QuestionRe: cpuh header is not supported by my compiler .. What should i do to make it support.? Pin
CPallini22-Jan-09 6:11
mveCPallini22-Jan-09 6:11 
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 
Hello,
this is quite a newbie question but I would appreciate a lot your help..
Let's suppose I want to implement an algorithm that behaves like the matlab "diff" command, that is given an input array of size N [x(1)......x(n)] it returns an array of N-1 elements [x(2)-x(1) .... x(n) - x(n-1)], like a sort of discrete derivative.
I would like to avoid to use vectors but simply arrays. The problem is I don't know how to create the second array of size N - 1. I could compute the size a priori and pass it as a parameter, but if I write


float* OUTarr = diff(float* INarr)
int size = sizeof(INarr)/sizeof(float);
float OUTarr[size];


two problems arise: first the size is always one (not depending on the real size of INarr) and second there's a compiler error 'expected a constant size'.
The same appears if I pass the size as a parameter of the function.
I know that allocation for arrays is static and actually I can't know the size of the array at compile time, but I could always know the exact size of the array before its allocation, so I shouldn't require the use of dynamic memory...
Thank you in advance for any suggestion!

L.
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 
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 

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.