I learned C and a tiny bit of C++ in school, and when going back and trying to reteach myself C++ for work, it is very hard because almost all of what I remember from class is C, which is apparently bad to use in C++ (eg: fscanf, malloc). one thing that confuses me is classes and constructors. here is an example that confuses me immensely.
why does this work:
fstream a;
a.open("foo.txt", std::fstream::in | std::fstream::out);
but:
fstream a();
a.open("foo.txt", std::fstream::in | std::fstream::out);
not work? isn't calling a default constructor the same as declaring an instance of a type?