0

When I compiled my code for the Section video titled, "Functions" where we were to make and define the function valid_triangle, the following error code was printed:

triangle.c:15:9: error: expected expression
    if (bool valid_triangle = true)
        ^
/usr/lib/llvm-3.6/bin/../lib/clang/3.6.0/include/stdbool.h:31:14: note: expanded from macro 'bool'
#define bool _Bool
             ^
1 error generated.

and I have no idea what it means.

I put my code on pastebin: http://pastebin.com/JfGBs2M7 thank you for any help!

0

Simply put, you're trying to declare and initialize a variable with the name valid_triangle in the test condition clause of an if statement. On top of that, valid_triangle() is a function whose name is being used as a variable name. Finally, a single = is the assignment operator. == is the test to see if two things are equal.

You should review the class material on functions, if statements and declaring variables.

If this answers your questions, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .