body > ol > li {color: silver;}
Friday, February 15, 2013
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
Subscribe to:
Posts (Atom)
Followers
Link
Labels
Agille
(3)
Angular 2
(96)
Architecture
(7)
ASP .Net
(30)
C#/VB .Net
(161)
Entityframework
(11)
General
(33)
Git
(2)
Hosting
(2)
HTML
(4)
Interview
(12)
Interview-Agile
(1)
Interview-Angular
(25)
Interview-ASP .Net
(3)
Interview-C#
(16)
Interview-JavaScript
(1)
Interview-MVC
(30)
Interview-SQL Server
(4)
Interview-WCF
(2)
Islam
(6)
Java Script
(37)
JQuery
(1)
MVC
(53)
NodeJS
(1)
Puzzles
(1)
React-Native
(3)
Security
(1)
Shayri
(10)
SQL Server
(41)
VC++
(5)
WCF
(21)
Web API
(27)
WPF
(21)