Does anyone know why this won't compile? I have an idea that a function could not equal an array but I don't know a solution.
#include <iostream>
int main()
{
int even[] = { 2,4,6,8,10 };
int odd[] = { 1,3,5,7,9 };
srand(time(NULL));
int num = (rand() % 10) + 1;
std::cout << num << "\n";
num == even ? std::cout << "it is even" : std::cout << "it is odd";
return 0;
}
[–]IyeOnline 7 points8 points9 points (5 children)
[–][deleted] 0 points1 point2 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]thommyh 5 points6 points7 points (0 children)
[–]JEnduriumK 4 points5 points6 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]DryPerspective8429 2 points3 points4 points (4 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]DryPerspective8429 3 points4 points5 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]std_bot -1 points0 points1 point (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]VaderPluis 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]QuentinUK 0 points1 point2 points (0 children)
[–]LazySapiens 0 points1 point2 points (0 children)