I'm new at programming and can someone explain to me how this code work?
#include <iostream>
using namespace std;
int main () {
int a = 3, b = 4;
decltype(a) c = a;
decltype((b)) d = a;
++c;
++d;
cout << c << " " << d << endl;
}
I'm quite confused how this code run as they give me a result of 4 4, shouldn't be like 5 5? Because it was incremented two times by c and d? I'm getting the hang of decltype but this assignment caught me confused how code works again.