Razmig said:
Before considering a serious use of Borland's C++ compilers please
note the following.
Borland C++ compilers aren't %100 conformant with the ISO C++
standard.
For example, the following obvious code won't compile on BCC32 5.5 nor
BCC32 5.6, though it's %100 compliant with the standard.
#include<iostream>
#include<string>
using namespace std ;
struct employee {
string name ;
string surname ;
} ;
int main ()
{
employee e = { "Razmig", "K" } ;
cout << e.name << " " << e.surname << '\n' ;
}
Presently none compiler can claim 100% C++ standard compliance. Every
one has its own strengths and weaknesses.
As it concerns Borland C++ those incompatibilities are not numerous and
most of them I ever fell into actually enforce better programming style
and it may even apply to the posted example. The struct 'employee'
containing non-POD members is not trivial. It is unlikely that all
employees of an organization will be known at compile time and
constructing dynamically such an object without relevant constructor in
C++ is ugly. So defining a constructor for 'employee' will help compile
and ensure better functionality of the entire program.
Regards,
Janusz