ArkM and SamBones,
I did eventually get through ArkM's code. Although I do not yet fully understand the code, I can see the logic of it all. It seems that it is not exactly what code is used, but how it is called.
I have much to learn, and hope to get there. I can't believe you even have to...
ArkM,
Thanks for your post. In truth I am not to that level of coding, I don't even understand the majority of the code. I was just trying to fix mine. So there is not hope for mine? It seems there must be something I can do to fix it. Well thanks anyway.
et
SamBones or Coders,
Even after I remove the getchar() and move the scannum() I still get the following return:
[etorres@onyx prog7]$ a.out
**********************************************************
Please enter three sides A, B, and C to calculate the area
of the triangle, negative numbers...
Coders,
This code is to scan three values, a, b,and c, and calculate the area of a triangle. If the input is negative there needs to be a error, is the value underneath the sqrt is negative there needs to be an error. So the code compiles OK, but it seems to be caught in a loop when a negative...
ArkM and columb,
Thank you for your posts. I really appreciate your input. I want to be a good coder so this information will be great. I now understand the previous posts. Thanks.
et
ArkM,
Please forgive my ignorance. I am new to C and clearly don't understand your first response. If I don't use global variables then how do I pass the info to other functions? Your #2, I assume you mean that I should then create functions which only perform one thing. But will these fix my...
Coders,
I have been working on this code for the last few days. I have the just of the code complete, yet one issue still arises. This code needs to calculate the area of a triangle. The sides a, b, and c are provided by the users and the sides are divided by 2, then that answer is calculated...
I have been working on the following code. I use the Unix gcc compiler, which compiles the code OK. Using Dev C++ just gives me an error indicating that the application must close. The error I get in gcc is 'segmentation fault', but using g++ I also get 'segmentation fault', after I run a.out...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.