473,562 Members | 2,600 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there "Default Peremeter" in C#?

It seems that when I define a fuction,I can set a default value to some of
the peremeters.When I call the fuction without some of them,the fuction will
use the default value automaticlly then continue to work.But I'v fogot how
to use,even I'v fogot whether I can use it in C# or not.
Help me.
Nov 15 '05 #1
18 2239
C# has no default parameters, it uses overloading isntead.
"Clark Nu" <cl*****@hit.ed u.cn> wrote in message
news:O7******** ******@TK2MSFTN GP10.phx.gbl...
It seems that when I define a fuction,I can set a default value to some of
the peremeters.When I call the fuction without some of them,the fuction will use the default value automaticlly then continue to work.But I'v fogot how to use,even I'v fogot whether I can use it in C# or not.
Help me.

Nov 15 '05 #2
Could you upate your clock?

José
"Clark Nu" <cl*****@hit.ed u.cn> a écrit dans le message de
news:O7******** ******@TK2MSFTN GP10.phx.gbl...
It seems that when I define a fuction,I can set a default value to some of
the peremeters.When I call the fuction without some of them,the fuction will use the default value automaticlly then continue to work.But I'v fogot how to use,even I'v fogot whether I can use it in C# or not.
Help me.

Nov 15 '05 #3
"news.microsoft .com" <an********@dis cussions.micros oft.com> schrieb im
Newsbeitrag news:#S******** ******@TK2MSFTN GP11.phx.gbl...
C# has no default parameters, it uses overloading isntead.


You name isn't really news.microsoft. com, is it?

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 15 '05 #4
OMG REALLY!

"codymanix" <do************ *********@gmx.d e> wrote in message
news:Ok******** *****@TK2MSFTNG P11.phx.gbl...
"news.microsoft .com" <an********@dis cussions.micros oft.com> schrieb im
Newsbeitrag news:#S******** ******@TK2MSFTN GP11.phx.gbl...
C# has no default parameters, it uses overloading isntead.


You name isn't really news.microsoft. com, is it?

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 15 '05 #5
> "news.microsoft .com" <an********@dis cussions.micros oft.com> schrieb im
Newsbeitrag news:#S******** ******@TK2MSFTN GP11.phx.gbl...
C# has no default parameters, it uses overloading isntead.


You name isn't really news.microsoft. com, is it?


Yeah, I've noticed that guy too. My suspicion is that
"news.microsoft .com" is an Agent. Everyone who has tried to fight this agent
has died. Be extremely careful. Default Params are useful, but they aren't
worth dieing for....
Nov 15 '05 #6
How useful compared to an overloaded method, cand you split out the common
code and just use overloads, overloading is more natural to me. I want to
..Delete() does em all or .Delete(int) does a specific one.

I find coding solutions like that more natural.

"David Sworder" <ds******@cts.c om> wrote in message
news:#L******** *****@TK2MSFTNG P09.phx.gbl...
"news.microsoft .com" <an********@dis cussions.micros oft.com> schrieb im
Newsbeitrag news:#S******** ******@TK2MSFTN GP11.phx.gbl...
C# has no default parameters, it uses overloading isntead.
You name isn't really news.microsoft. com, is it?


Yeah, I've noticed that guy too. My suspicion is that
"news.microsoft .com" is an Agent. Everyone who has tried to fight this

agent has died. Be extremely careful. Default Params are useful, but they aren't
worth dieing for....

Nov 15 '05 #7
actually news.microsoft. com is the default user for posts via
msdn.microsoft. com web site.

"news.microsoft .com" <an********@dis cussions.micros oft.com> wrote in message
news:#l******** *****@tk2msftng p13.phx.gbl...
How useful compared to an overloaded method, cand you split out the common
code and just use overloads, overloading is more natural to me. I want to
.Delete() does em all or .Delete(int) does a specific one.

I find coding solutions like that more natural.

"David Sworder" <ds******@cts.c om> wrote in message
news:#L******** *****@TK2MSFTNG P09.phx.gbl...
"news.microsoft .com" <an********@dis cussions.micros oft.com> schrieb im
Newsbeitrag news:#S******** ******@TK2MSFTN GP11.phx.gbl...
> C# has no default parameters, it uses overloading isntead.

You name isn't really news.microsoft. com, is it?


Yeah, I've noticed that guy too. My suspicion is that
"news.microsoft .com" is an Agent. Everyone who has tried to fight this

agent
has died. Be extremely careful. Default Params are useful, but they aren't worth dieing for....


Nov 15 '05 #8
According to C# Pro magazine, all the underlying code in VB.NET does when
you use Optional Params is write the overload for you.... I've looked at
the IL and couldn't verify it, but I'm far from an expert in IL.

I agree too, optionals are eveil.
"David Sworder" <ds******@cts.c om> wrote in message
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. .
"news.microsoft .com" <an********@dis cussions.micros oft.com> schrieb im
Newsbeitrag news:#S******** ******@TK2MSFTN GP11.phx.gbl...
C# has no default parameters, it uses overloading isntead.
You name isn't really news.microsoft. com, is it?


Yeah, I've noticed that guy too. My suspicion is that
"news.microsoft .com" is an Agent. Everyone who has tried to fight this

agent has died. Be extremely careful. Default Params are useful, but they aren't
worth dieing for....

Nov 15 '05 #9
Oh, he did. To get him to the top of the list no doubt.
Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5723
by: whtevr | last post by:
Consider this HTML on an ASP page called default.asp in a virtual directory: <FORM name="Flogin" id="Flogin" action="" method=post> </FORM> Do I HAVE to put the literal "default.asp" into the action attrib to get this form to post back to the "default.asp" page in that directory?
13
2266
by: DaKoadMunky | last post by:
I recently came across some code in a template that default constructed an object of type T to pass to another function... SomeFunction(T()); The code that instantiates that template specifies T as an int. Proper program behavior relies on that "default constructed" int being zero. That lead me to the following example...
9
3707
by: Pierre Senellart | last post by:
The C++ standard states (26.3.2.1), about std::valarray constructors: > explicit valarray(size_t); > > The array created by this constructor has a length equal to the value of > the argument. The elements of the array are constructed using the default > constructor for the instantiating type T. Does that mean that, on built-in types...
12
4934
by: Stefano | last post by:
Hi all, what is the correct use of the "default" attribute in XML Schema? For example: <xs:element name="myProperty" type="xs:string" default="myDefaultValue"/> What can I do with it? What is the meaning of < ....default="myDefaultValue" /> ?
5
3897
by: Hendrik Schober | last post by:
Hi, we just run into the problem, that "default" alignment in the project properies dialog seem to be different. We have a project that's a DLL, which is linked with a couple of LIBs. All are with the same solution. All had "Default" set in the "Struct Member Alignment" entry. After some assembler debugging we found out that a struct...
8
3494
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I cannot load/unload/reload extensions into my large and slow-to-load application during development without restarting the process then the...
15
12525
by: simonoficina | last post by:
Hello all! I am a vb.net beginner in Spain. When I use VB6 ,the button object has a property called "default" that can set this button like press "ENTER" key. But in the VB.net I can't find this property. Where is it? Or mabye change the other thing,No?Thanks ! Simon
3
2550
by: kjworm | last post by:
Greetings, I have a report displayed on a screen that anyone in the office can look at. The data on this report will change from time to time. This report has different colors displayed depending on the data. Since I'm using Access '97, I can't do this on a form. What I am doing is "refreshing" this report every 60 seconds. Since Access...
0
7869
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7627
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7935
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5477
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5193
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2073
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
903
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.