Hello.
I've got a function and I want to handle exceptions within it.
If I handle exceptions within 'main', there are no errors,
but if I try it within my_function, I get memory errors.
---------------//------------
void my_function() {
...
if (x > 0) {
int exception_local;
exception_local = 1002;
throw(exception_local);} //I get here memory errors
}
//main:
try {
...
if (!fileIN){
int exception_local;
exception_local = 1001;
throw(exception_local);} //I do not get any memory error
...
externalfunction()
...
}
catch(int exception_local) {
my_exception = exception_local; }
------------//--------------
What am I doing wrong?
Thank you very much.
I've got a function and I want to handle exceptions within it.
If I handle exceptions within 'main', there are no errors,
but if I try it within my_function, I get memory errors.
---------------//------------
void my_function() {
...
if (x > 0) {
int exception_local;
exception_local = 1002;
throw(exception_local);} //I get here memory errors
}
//main:
try {
...
if (!fileIN){
int exception_local;
exception_local = 1001;
throw(exception_local);} //I do not get any memory error
...
externalfunction()
...
}
catch(int exception_local) {
my_exception = exception_local; }
------------//--------------
What am I doing wrong?
Thank you very much.