Linked Questions

0
votes
1answer
1k views

Error: control may reach end of non-void function [duplicate]

I am currently working on pset3/search and when I try to compile the codes it keeps telling me that ^ error. I know that it is because I must not be returning a boolean value as needed, but I do not ...
0
votes
1answer
467 views

pset 3 “control may reach the end of a non-void function” [duplicate]

I know what this error means, but how do I fix it? I'm using a if... else... function, so I'm not sure how to improve upon that. Thanks!
0
votes
1answer
397 views

“Error: control may reach end of non-void function”. What causes this error? [duplicate]

I'm working with code (that I am not the primary author of) and trying to get it to run. It tests to see if a number is prime or not. It gives me the error error: "control may reach end of non-void ...
0
votes
1answer
200 views

“Control may reach end of non-void function” but I'm sure my else statements take care of it? [duplicate]

I know this has been asked many times before, but I looked through all the questions and still don't get it. I know what the error means, I'm just convinced that my code ensures that whatever happens,...
0
votes
1answer
132 views

Pset3 Binary Search gets “may reach end of non-void function” error or “inker command failed with exit code 1” [duplicate]

I'm going insane! Pset3 binary search. My code seems to be correct but I keep getting errors when trying to make helpers. Find works with generate when I search for a number that exists but hangs ...
0
votes
0answers
74 views

Control may reach end of non-void function [duplicate]

I have read the following and am still unable to answer my question: How to Fix “control may reach end of non-void function” and “No such file or directory” Errors? Error: control may reach end of ...
0
votes
1answer
24 views

pset3 control may reach end error [duplicate]

this is my code, iv seen the other possibilities of getting this error and corrected them but i still get it. bool move(int tile) { int a = board[d][d]; for(int i =0; i<d;i++) { for( int j=...
1
vote
1answer
971 views

What do I get compilation errors when compiling bounce.c?

I copied the source code for bounce.c and tried to compile it, but I got these errors. This also happens for other programs that use the SPL. jharvard@appliance (~/new): make bounce clang -ggdb3 -...
0
votes
2answers
100 views

I wrote this program as per the recursion video but its giving one error

here is the code and error is"control may reach end of non-void function [-Werror,-Wreturn-type]" #include <stdio.h> #include <cs50.h> #include <stdlib.h> int collatz( int n, int c);...
0
votes
0answers
151 views

pset3 - check50 for find returns frowny face

I must be missing something on my code for pset3. When i run the Check50 i get this messages : :) finds 42 in {41,42,43} :( finds 42 in {40,41,42} \ expected an exit code of 0, not 1 After ...
0
votes
1answer
115 views

Pset3 - Music: Unused parameters and control reaches end of non-void function errors

I have tried and googled everything, but I cannot seem to fix these mysterious errors. Within my helpers.c file, it is saying that I haven't used any of the parameters although I've used all of them. ...
0
votes
1answer
58 views

Why do i need a return value when my program will recurse until it does in fact return a value?

To fix this problem all i need to do is return something in the else part of the if statement, but it seems so pointless and messy because the program is designed to recurse until a value is returned. ...
0
votes
1answer
40 views

Won() function not working and gives error

This error is shown while compiling(error is pointed to the last closing bracket of won function)- error: control may reach end of non-void function [-Werror,-Wreturn-type]. here is my code for won()...