Hi.
I was wondering if anyone could help me?
Basically I have a function that takes in a struct pointer and returns a struct pointer to the main program. The function itself has a loop in it that loops through a global array.
I want the function to return one and only one struct to the main function when it finds it.
In other words:-
(grid[][] is a 2-D global array of struct pointers)
for(i=0;i<100<i++){
for(j=0;j<100;j++){
if(a certain condition is met){
return(grid[j]);
// exit??? to main program, returning only the
// first struct pointer it finds, and not looping
//through the rest and returning them.
}
}
}
Thanks.
D
I was wondering if anyone could help me?
Basically I have a function that takes in a struct pointer and returns a struct pointer to the main program. The function itself has a loop in it that loops through a global array.
I want the function to return one and only one struct to the main function when it finds it.
In other words:-
(grid[][] is a 2-D global array of struct pointers)
for(i=0;i<100<i++){
for(j=0;j<100;j++){
if(a certain condition is met){
return(grid[j]);
// exit??? to main program, returning only the
// first struct pointer it finds, and not looping
//through the rest and returning them.
}
}
}
Thanks.
D