#include <iostream>
using namespace std;
int main()
{
char id[6] = "apple";
if (id == "apple")
{
cout << "True";
}
else
{
cout << "False";
}
return 0;
}
==
among operators is an operator that compares whether the values are the same or different among logical operators, right?
Then shouldn't the value "apple"
be displayed as True in the if statement when the value is entered in the variable
id
as above? It's my first time doing c++, so I'm not sure Haha
char id[6] = "apple"; When you execute a command statement, id[0] == "a" id[1] == "p" id[2] == "p" id[3] == "l" id[4] == "e" The "apple" is going to be scattered a, p, p, l, e.
In the conditional statement if(id == "apple"), id is not the entire array id Accepts a specific column of array id (id[random]).
© 2024 OneMinuteCode. All rights reserved.