February 24, 2004

Initializing Class Members

The following code demonstrates how to initialize class members in the initialiser list for more efficiency: class A{int a;char b;float c;public: A();};A::A():a(0),b(0),c(0){}is more efficient thanA::A(){ a = 0; b =

Changing the Attributes of a File

Say you’re trying to overwrite an existing file, but its attribute is set to “Readonly,” so it generates a “Permission Denied” error. The following code shows how to change the