In trying to write the following C++ program, I got some build errors..... #incl
ID: 1798703 • Letter: I
Question
In trying to write the following C++ program, I got some build errors.....#include <iostream>
#include <cstdlib>
#include <string>
#include <iomanip>
using namespace std;
int main()
{
int boolean;
int num1, num2, num3;
int s1,s2,s3;
char right[]="false";
s1=num1*num1;
s2=num2*num2;
s3=num3*num3;
if((s1+s2) == s3)
right="true";
else if((s1+s3) == s2)
right="true";
else if ((s2+s3) == s1)
right="true";
else
right="false";
return(0);
}
My visual Studio says that lines 19, 21, 23, and 25 have some sort of error with the '=' and that it "cannot convert from 'const char [5]' to 'char [6]' There is no context in which this conversion is possible."
Could someone please clarify for me where I made my mistake? thanks, in advance, for any assistance.....
Explanation / Answer
im not sure how much this helps i have not used C++ in a while, but you did not classify or clarify "true" only false.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.