As I noticed everybody says that THE ONLY difference between classes and structs is access mode.
But I have noticed that initialization is also different.
I mean if we have
struct SA{int n;};
class CA{public:int n;}
then we can write
SA sa = {2};
but we cannot write
CA ca = {2}; // compile error
Is not a difference also?
cigur 0 Newbie Poster
vmanes 1,165 Posting Virtuoso
Stinomus 11 Junior Poster
monkey_king 39 Junior Poster
ArkM 1,090 Postaholic
tux4life 2,072 Postaholic
NicAx64 commented: thanks I'm digging you'r post +1
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.