473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

can you please give differences between default and constant arguments

More explanation about default and constant arguments
Jan 30 '15 #1
3 3657
weaknessforcats
9,208 Expert Mod 8TB
If you fail to supply a value for an argument, a default value can be provided.

A constant argument means the function will not change the value of the argument.
Jan 30 '15 #2
donbock
2,426 Expert 2GB
Are you asking about command line arguments?

Unless you're doing something tricky, the function prototype will coerce you into supplying all the function arguments -- there cannot be such a thing as default function arguments. However, there are tricky ways to get around this.

Are you referring to the const keyword when you say "constant arguments"? You will get a compiler error if you try to change the value of a function argument that is declared const.

C uses call-by-value. This means that changes made to an argument inside a function are not seen by the code that called the function. (There are tricky ways to get around this too.)
Jan 30 '15 #3
weaknessforcats
9,208 Expert Mod 8TB
There are default function argumenta in C++ but not in C.

That is to say, default VALUES for function arguments.
Jan 30 '15 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Frans Englich | last post by:
Hello, I've stumbled over a behavior related to default function arguments which appears to be a bug, from what I can tell. See this snippet: >>> from kdecore import KURL >>> u = KURL(...
1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
1
by: George Sakkis | last post by:
Hi all, I have the following two template function definitions: template <typename Container, typename Sepatator> string join(const Container& c, const Sepatator& s) { // ... } template...
4
by: sods | last post by:
Hi, I write a test code about template used for strategy. it's very similar to sample code in TC++PL 13.4.1. #include <iostream> #include <string> using std::basic_string;
1
by: Ellen12c | last post by:
On the last post I asked about a code to make a vertical scroll bar and ends up I didn't need one. I was told by a big group of people on this forum that I needed to do away with all the flash and...
1
by: junglenut | last post by:
please give me a reverse word java program in a form of jcreator javax.swing.*; source code.. because i really have a hard time figuring it out on how to make it.. please give me a reverse word...
1
by: anoopev | last post by:
I want to read jad and jar files from generated location in my application. How do i do this? and after reading how it is send to email by button click action. Please give me immediate...
0
by: Chris Thomasson | last post by:
Is the following use of default template arguments Kosher? _______________________________________________________________ template< typename T, void (T::*T_fp_start) () = &T::start, void...
1
by: fareednn | last post by:
add button enabled in IE 8 AND disabled in IE7 please give me the solution. same code i m using in both IE 7 AND IE 8 PLEASE GIVE ME THE SOLUTION what to be done where to be changed pls reply me the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.