L
L
Leshiy952016-10-19 22:29:58
Programming
Leshiy95, 2016-10-19 22:29:58

How to set boolean function in c++ in xcode program?

I'm trying to write a c++ function that returns a bool, for example bool Positive(double X); writes that it should be void. What to do?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maxim, 2016-10-19
@Got_Oxidus

Try

#include <stdbool.h>
#define BOOL bool

R
rhaport, 2016-10-20
@rhaport

[shaman]
most likely you have void in *.h, and in *.c you replaced void with bool, so the compiler swears
[/shaman]
show the code :)

J
Jacob E, 2016-10-20
@Zifix

If it comes to that, then you can always use int instead of bool, under the hood it's the same thing, it's just a little clearer for people.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question