I was trying to write an algorithm that would take 2 numbers as input and output them in ascending order using the ternary operator, but on line 20:24 it tells me:
error: invalid array assignment
Can someone help me?
#include <iostream>
using namespace std;
int main()
{
int a, b;
int c[2];
int d[2];
int e[2];
cout << "inserire il primo numero: ";
cin >> a;
cout << "inserire il secondo numero: ";
cin >> b;
c[0] = b;
c[1] = a;
d[0] = a;
d[1] = b;
e = (a > b) ? c : d;
cout << e;
}