473,378 Members | 1,478 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,378 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 3655
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.