Friday, February 15, 2013

Parent-Child Relationship in CSS

body > ol > li {color: silver;}

Friday, February 8, 2013

Default Param in VC++




Declaration :
void AddVal(int iFirstVal, int iSecondVal=0);

Definition
void AddVal(int iFirstVal, int iSecondVal)
{

int iVal = iFirst+iSecond;
    cout << "Sum : " << iVal << endl;

}
int main()
{
    AddVal(1); // nValue2 will use default parameter of 10
    AddVal(3, 4); // override default value for nValue2
}

1. Default Parameter should be last parameter.[Otherwise hot compiler will know which attributes should be omit.]
2. No default value allowed in definition. Default value should be given only in declaration.
3. Default arguments can be provided for pointers to functions. For example:
int (*pShowIntVal)( int i = 0 );

Friday, February 1, 2013

Readonly and Const

We can assign a value to a readonly variable at runtime (in constructor only)
till it is a unassigned identifier, but once value is 
assigned, it cannot be changed.

In case of const we cannot assign a value at run time i.e. 
the value assigned to it at declaration time cannot be 
change

Followers

Link