C++ Recursion Returning Two Void Functions [closed]











up vote
-1
down vote

favorite












I am attempting to make a maze solving algorithm.



Inside this algorithm where i want to return multiple recursion statements, however I get this error.



error: invalid operands of types 'void' and 'void' to binary 'operator+'
return find(x,y+1) + find(x,y-1);
~~~~~~~~~~~~^~~~~~~~~~~~~



This line is called within the void find() function.



obviously, it doesn't allow me to return two void functions. However, I don't know how else to do this. I don't want any return values (I want it to simply end once a solution is found). I can't add these return values to another function, because that would simply be moving the problem elsewhere without solving my issue.



Is there a possible way that I could return two void functions?



Using mingw to compile my code (command line: g++ main.cpp)










share|improve this question













closed as off-topic by n8te, Máté Juhász, Mokubai Nov 16 at 8:07


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – n8te, Máté Juhász, Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    If you don't want to have any return values, then why do you attempt to add them?? There is some other error in logic, so you need to share more codes and explain what exactly you try to do. But please do it on stackoverflow as programming is off topic here.
    – Máté Juhász
    Nov 16 at 7:43










  • Programming questions belong on Stack Overflow. You should also include sample code demonstrating how to reproduce your problem.
    – Mokubai
    Nov 16 at 8:08










  • ok, sorry about that. I will post it in stack overflow. The sample code is the code in the error.
    – Milkev Gaming
    Nov 16 at 8:31










  • @MilkevGaming StackOverflow will want more, otherwise, your question will be closed there also.
    – Ramhound
    Nov 16 at 9:01















up vote
-1
down vote

favorite












I am attempting to make a maze solving algorithm.



Inside this algorithm where i want to return multiple recursion statements, however I get this error.



error: invalid operands of types 'void' and 'void' to binary 'operator+'
return find(x,y+1) + find(x,y-1);
~~~~~~~~~~~~^~~~~~~~~~~~~



This line is called within the void find() function.



obviously, it doesn't allow me to return two void functions. However, I don't know how else to do this. I don't want any return values (I want it to simply end once a solution is found). I can't add these return values to another function, because that would simply be moving the problem elsewhere without solving my issue.



Is there a possible way that I could return two void functions?



Using mingw to compile my code (command line: g++ main.cpp)










share|improve this question













closed as off-topic by n8te, Máté Juhász, Mokubai Nov 16 at 8:07


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – n8te, Máté Juhász, Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    If you don't want to have any return values, then why do you attempt to add them?? There is some other error in logic, so you need to share more codes and explain what exactly you try to do. But please do it on stackoverflow as programming is off topic here.
    – Máté Juhász
    Nov 16 at 7:43










  • Programming questions belong on Stack Overflow. You should also include sample code demonstrating how to reproduce your problem.
    – Mokubai
    Nov 16 at 8:08










  • ok, sorry about that. I will post it in stack overflow. The sample code is the code in the error.
    – Milkev Gaming
    Nov 16 at 8:31










  • @MilkevGaming StackOverflow will want more, otherwise, your question will be closed there also.
    – Ramhound
    Nov 16 at 9:01













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I am attempting to make a maze solving algorithm.



Inside this algorithm where i want to return multiple recursion statements, however I get this error.



error: invalid operands of types 'void' and 'void' to binary 'operator+'
return find(x,y+1) + find(x,y-1);
~~~~~~~~~~~~^~~~~~~~~~~~~



This line is called within the void find() function.



obviously, it doesn't allow me to return two void functions. However, I don't know how else to do this. I don't want any return values (I want it to simply end once a solution is found). I can't add these return values to another function, because that would simply be moving the problem elsewhere without solving my issue.



Is there a possible way that I could return two void functions?



Using mingw to compile my code (command line: g++ main.cpp)










share|improve this question













I am attempting to make a maze solving algorithm.



Inside this algorithm where i want to return multiple recursion statements, however I get this error.



error: invalid operands of types 'void' and 'void' to binary 'operator+'
return find(x,y+1) + find(x,y-1);
~~~~~~~~~~~~^~~~~~~~~~~~~



This line is called within the void find() function.



obviously, it doesn't allow me to return two void functions. However, I don't know how else to do this. I don't want any return values (I want it to simply end once a solution is found). I can't add these return values to another function, because that would simply be moving the problem elsewhere without solving my issue.



Is there a possible way that I could return two void functions?



Using mingw to compile my code (command line: g++ main.cpp)







c++ mingw recursion






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 16 at 7:33









Milkev Gaming

713




713




closed as off-topic by n8te, Máté Juhász, Mokubai Nov 16 at 8:07


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – n8te, Máté Juhász, Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by n8te, Máté Juhász, Mokubai Nov 16 at 8:07


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This question is not about computer hardware or software, within the scope defined in the help center." – n8te, Máté Juhász, Mokubai

If this question can be reworded to fit the rules in the help center, please edit the question.








  • 1




    If you don't want to have any return values, then why do you attempt to add them?? There is some other error in logic, so you need to share more codes and explain what exactly you try to do. But please do it on stackoverflow as programming is off topic here.
    – Máté Juhász
    Nov 16 at 7:43










  • Programming questions belong on Stack Overflow. You should also include sample code demonstrating how to reproduce your problem.
    – Mokubai
    Nov 16 at 8:08










  • ok, sorry about that. I will post it in stack overflow. The sample code is the code in the error.
    – Milkev Gaming
    Nov 16 at 8:31










  • @MilkevGaming StackOverflow will want more, otherwise, your question will be closed there also.
    – Ramhound
    Nov 16 at 9:01














  • 1




    If you don't want to have any return values, then why do you attempt to add them?? There is some other error in logic, so you need to share more codes and explain what exactly you try to do. But please do it on stackoverflow as programming is off topic here.
    – Máté Juhász
    Nov 16 at 7:43










  • Programming questions belong on Stack Overflow. You should also include sample code demonstrating how to reproduce your problem.
    – Mokubai
    Nov 16 at 8:08










  • ok, sorry about that. I will post it in stack overflow. The sample code is the code in the error.
    – Milkev Gaming
    Nov 16 at 8:31










  • @MilkevGaming StackOverflow will want more, otherwise, your question will be closed there also.
    – Ramhound
    Nov 16 at 9:01








1




1




If you don't want to have any return values, then why do you attempt to add them?? There is some other error in logic, so you need to share more codes and explain what exactly you try to do. But please do it on stackoverflow as programming is off topic here.
– Máté Juhász
Nov 16 at 7:43




If you don't want to have any return values, then why do you attempt to add them?? There is some other error in logic, so you need to share more codes and explain what exactly you try to do. But please do it on stackoverflow as programming is off topic here.
– Máté Juhász
Nov 16 at 7:43












Programming questions belong on Stack Overflow. You should also include sample code demonstrating how to reproduce your problem.
– Mokubai
Nov 16 at 8:08




Programming questions belong on Stack Overflow. You should also include sample code demonstrating how to reproduce your problem.
– Mokubai
Nov 16 at 8:08












ok, sorry about that. I will post it in stack overflow. The sample code is the code in the error.
– Milkev Gaming
Nov 16 at 8:31




ok, sorry about that. I will post it in stack overflow. The sample code is the code in the error.
– Milkev Gaming
Nov 16 at 8:31












@MilkevGaming StackOverflow will want more, otherwise, your question will be closed there also.
– Ramhound
Nov 16 at 9:01




@MilkevGaming StackOverflow will want more, otherwise, your question will be closed there also.
– Ramhound
Nov 16 at 9:01















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

QoS: MAC-Priority for clients behind a repeater

Ивакино (Тотемский район)

Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)