Original Post
Hi, I'm curious, why doesnt' the following function work? or rather, why doesn't the allocated memory stay beyond the scope of the function that created it? I can easily bypass this problem by creating float[100] and handing that to the doStuff function, but that doesn't allow for a clean user-transparent code. So, anyone? /Robert
void doStuff(float *Kalle)
{
Kalle = new float[100];
//Kalle == float[100]...
}
//...
main loop:
{
doStuff(Kalle);
//Kalle == 0x0.... wtf?
}