What is the difference between these two default Constructors? (C++)

Viewed 75

This is a quick question, Probably has already been answered somewhere but I can't find anything... I might just be blind.

Is there any meaningful differences between making a default constructor like this:

Complex(){
  Real = 0;
  Imag = 0;
}

or like this:

Complex(): Real(0), Imag(0){}

or is it just a simple difference in syntax?

And which one is more prevalent and is usually used, or it doesn't matter and people use any? Thank you!

0 Answers
Related