1
struct RandomStruct {
  RandomStruct(int a) {

  }
}

int main() {
  RandomStruct works();
  RandomStruct doesntWork = RandomStruct();
  RandomStruct doesntWork2{};
}

Why is it that the second two intitializations don't work, but the first does? Should I use one form over another? This behaviour is rather bewildering to me.

Thanks!

0 Answers0