Whats the difference? Are they not the same?
Whats the difference? Are they not the same?
I am against the teaching of evolution in schools. I am also against widespread
literacy and the refrigeration of food.
They are the same. Well except for the minor difference that class members are by default private and struct's, public.
Code:class X { int private_num; public: int public_num; }; struct X { int public_num; private: int private_num; };
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Can we have member functions in structs?
Can we make inheritance with structs?
Can we overload operators?
Correct me if I'm wrong... I think (no).
YesOriginally posted by ammar
Can we have member functions in structs?
Can we make inheritance with structs?
Can we overload operators?
Correct me if I'm wrong... I think (no).
Yes
and Yes
Structs are just like classes...excepts public by default
Mmmmmm...
Thanks, I didn't know that...
So there isn't a big difference.