Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
void updateFilter(bool bRecalc = true);
September 11, 2013 - 4:47 am
Member Since: August 27, 2013
Forum Posts: 13
sp_UserOfflineSmall Offline

Here's the line of code I'm having issues understanding.

void updateFilter(bool bRecalc = true);

We have a prototype here that has been placed in my main header file. What is the purpose of setting bRecalc within this declaration? I would expect this to look like:

void updateFilter(bool bRecalc);

Thanks for the help.

September 11, 2013 - 5:05 am
Member Since: August 27, 2013
Forum Posts: 13
sp_UserOfflineSmall Offline

My best guess is that it allows for the function call to have no value passed to it, and the default value will be true.

W Pirkle
September 11, 2013 - 7:26 pm
Member Since: January 29, 2017
Forum Posts: 573
sp_UserOfflineSmall Offline

Yes, that sets the default behavior so updateFilter() does the same thing as updateFilter(true). There are restrictions when you do this with multiple arguments (the ones with defaults have to be at the end of the list).

See also:


- Will

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Chaes: 51

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

jim: 34

JimmyM: 33

Gwen: 32

Member Stats:

Guest Posters: 1

Members: 696

Moderators: 1

Admins: 5

Forum Stats:

Groups: 13

Forums: 41

Topics: 757

Posts: 2894

Newest Members:

Jas, Rowan, sojourn, fabhenr, rg1, Niklas, Wutru, Tim Campbell, Danny Jonel, Valentin

Moderators: W Pirkle: 573

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 573, VariableCook: 3