Linked Questions

0 votes
1 answer
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 ...
Dafne Lecona's user avatar
0 votes
1 answer
470 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!
Yao Li's user avatar
  • 33
0 votes
1 answer
441 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 ...
user8357's user avatar
0 votes
1 answer
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,...
mathmagician's user avatar
0 votes
1 answer
136 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 ...
jdtodd79's user avatar
0 votes
0 answers
76 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 ...
Roxanne's user avatar
  • 33
0 votes
1 answer
25 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=...
Pavan Gudiwada's user avatar
1 vote
1 answer
985 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 -...
ahmed talat's user avatar
0 votes
2 answers
108 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);...
Ahmed Raza's user avatar
0 votes
1 answer
125 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. ...
aherzfeld's user avatar
0 votes
0 answers
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 ...
jon.tre's user avatar
0 votes
1 answer
83 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. ...
Michael's user avatar
0 votes
1 answer
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()...
Abhishek Patel's user avatar