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

Programming, Write a program that writes your name on the monitor ten times...

Write a program that writes your name on the monitor ten times. Write this program three times, once with each looping method.

Client-server architecture Project, I need a client-server architecture pro...

I need a client-server architecture program for windows OS (minimum support: Win 7),. the agent program will run as a background process and perform certain tasks every X time, and

Car rental project, I need a project on car rental system using c programmi...

I need a project on car rental system using c programming only of college level

Need solution for simple beginner level c program, search words from a pass...

search words from a passage and return snippets in html format..

Pointers, write short notes about void pointers

write short notes about void pointers

Program to find the number, i need a program that find the number of negati...

i need a program that find the number of negative integers in a list.

C, A palindrome is a string that reads the same from both the ends. Given a...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Constructor and destructor function with derived classes, Constructor and D...

Constructor and Destructor function with derived classes If there are constructors included in the base class and the derived class, the compiler automatically calls both of th

Class and object, how to write c++ code for financial system using class an...

how to write c++ code for financial system using class and object

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