LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN stack overflow error

Im using an recursiv c++ function in my VI.
After severall calls the VI crashes, printing an
stack overflow error.
I already increased in Visual Studio 6.0 the Link
setting: allocate stack. But nothing changed.
I need help fix this problem!!

My prg. looks like this:

recursiv (....) {
int array[..][..][..];
....
recursiv (..);
}


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 1 of 2
(3,908 Views)
> Im using an recursiv c++ function in my VI.
> After severall calls the VI crashes, printing an
> stack overflow error.
> I already increased in Visual Studio 6.0 the Link
> setting: allocate stack. But nothing changed.
> I need help fix this problem!!
>
> My prg. looks like this:
>
> recursiv (....) {
> int array[..][..][..];
> ....
> recursiv (..);
> }


If you are truly allocating a three D array of ints
on the stack, then it makes sense that you will run
out of stack space sooner or later. I can't help
you with increasing the stack size, but if you move
your array into a memory block and store the pointer
on the stack, then you will use less stack space and
avoid the problem.

In otherwords:

recursive() {
int *array;

array= DSNewPtr()
;
array[][][]= ...

recursive();
DSDisposePtr();
}


Greg McKaskle
0 Kudos
Message 2 of 2
(3,908 Views)