Differences between default initialisation

A

Angus

Hello

In C++ global and static variables (primitive) are zero initialised.
But member and local variables are not. Is this standard for other
languages? Why?

Angus
 
B

Bo Persson

Angus said:
Hello

In C++ global and static variables (primitive) are zero initialised.
But member and local variables are not. Is this standard for other
languages? Why?

Angus

This is all inherited from the C language.

Old C code, compiled as C++, should behave the way it used to -
especially performance-wise.


Bo Persson
 
V

Victor Bazarov

Angus said:
In C++ global and static variables (primitive) are zero initialised.
But member and local variables are not. Is this standard for other
languages?

How TF should we know? Ask in "other languages" newsgroups.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top