Constant argument, C/C++ Programming

Assignment Help:

Define Constant argument:

The argument can be a constant argument The constant variable cannot be changed inside the function definition when the argument is declared as constant.

 

void f_const(int x, const int y);

void main( )

{int a10, b=20,c;

c =f_const(a, b); //The value of c is 30

}

int f_ref(int x, const int y)

{ //y=20; // Is invalid because y is declared as constant variable. return (x+y);

}

 

void f_const(int x, const int y=100);

void main( )

{int a=200, b,c;

c =f_const(a); //The value of c is 300

}

int f_const(int x, const int y)

{ //y=20; // Is invalid because y is declared as constant variable. return (x+y);

}


Related Discussions:- Constant argument

Super ASCII String Cost, A string S is said to be "Super ASCII", if it cont...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Constructor, Why copy constructor accepts reference to an object and not t...

Why copy constructor accepts reference to an object and not the object itself, whether ah hence it we do otherwise

Tool for checking memeory leak, what would be the best tool for debuggingg ...

what would be the best tool for debuggingg memory leaks in c/c++ programming

C program for palindrome, C Program for Palindrome Norm...

C Program for Palindrome Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

What is the value of a resistor marked as 47kk, (a) Verify the values of th...

(a) Verify the values of the resistors with the following colour coding: (i) red-red-orange-silver (ii) orange-orange-black-blue-green (b) What is the value of a resistor

C program for even & odd no in any matrices , C Program for EVEN & ODD NO I...

C Program for EVEN & ODD NO IN ANY MATRICES #include stdio.h> #include conio.h> void main() {           int a[100][100];           int i=0,j=0,r,c,even=0,odd=0;

Scope resolution operator, what are the significances of scope resolution o...

what are the significances of scope resolution operator? Illustrate with example

#rotation, #write code for rotation in c

#write code for rotation in c

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd