Click here to Skip to main content
15,920,111 members
Home / Discussions / C#
   

C#

 
QuestionSending Email in .Net 2.0 Pin
Sarika Wake8-Jan-07 20:35
Sarika Wake8-Jan-07 20:35 
AnswerRe: Sending Email in .Net 2.0 Pin
Chris Buckett8-Jan-07 22:04
Chris Buckett8-Jan-07 22:04 
QuestionMIME Type in c# Pin
aruna_koride8-Jan-07 19:15
aruna_koride8-Jan-07 19:15 
AnswerRe: MIME Type in c# Pin
Mircea Puiu8-Jan-07 21:53
Mircea Puiu8-Jan-07 21:53 
Questionconst member function Pin
Maddie from Dartford8-Jan-07 18:00
Maddie from Dartford8-Jan-07 18:00 
AnswerRe: const member function Pin
Christian Graus8-Jan-07 18:04
protectorChristian Graus8-Jan-07 18:04 
GeneralRe: const member function Pin
led mike8-Jan-07 18:25
led mike8-Jan-07 18:25 
AnswerRe: const member function Pin
Guffa8-Jan-07 19:02
Guffa8-Jan-07 19:02 
gajesh wrote:
How to pass a const value by reference.


What you are asking for is either very simple or not possible at all, I haven't tried which. You can try it:

const int answer = 42;
SetData(ref answer);

void SetData(ref parameter) { ... }

This will either automatically create a copy of the constant before it's passed to the method, as a constant can not be changed, or it will produce a compilation error, as you have to copy the value yourself.

What it looks like you are trying to do from the code, is to make a constant argument, which is not supported in C#.

gajesh wrote:
How to use const member function in C#.


Methods are always constant, you can never change the definition of a method at runtime.

---
Year happy = new Year(2007);

GeneralRe: const member function Pin
CPallini8-Jan-07 21:17
mveCPallini8-Jan-07 21:17 
QuestionC# map template equivalent? Pin
swjam8-Jan-07 17:33
swjam8-Jan-07 17:33 
AnswerRe: C# map template equivalent? Pin
Christian Graus8-Jan-07 18:01
protectorChristian Graus8-Jan-07 18:01 
QuestionTerminating an Application ? Pin
Mike Bluett8-Jan-07 15:40
Mike Bluett8-Jan-07 15:40 
AnswerRe: Terminating an Application ? Pin
Lisa Jorgensen8-Jan-07 16:03
Lisa Jorgensen8-Jan-07 16:03 
GeneralRe: Terminating an Application ? Pin
Mike Bluett8-Jan-07 16:52
Mike Bluett8-Jan-07 16:52 
AnswerRe: Terminating an Application ? Pin
Lisa Jorgensen8-Jan-07 20:11
Lisa Jorgensen8-Jan-07 20:11 
QuestionDisable Window Close Pin
MasterYoda798-Jan-07 14:07
MasterYoda798-Jan-07 14:07 
AnswerRe: Disable Window Close Pin
Luc Pattyn8-Jan-07 14:20
sitebuilderLuc Pattyn8-Jan-07 14:20 
GeneralRe: Disable Window Close Pin
MasterYoda799-Jan-07 6:08
MasterYoda799-Jan-07 6:08 
QuestionHow create "always on bottom" apps? Pin
noemailz8-Jan-07 11:56
noemailz8-Jan-07 11:56 
AnswerRe: How create "always on bottom" apps? Pin
Ravi Bhavnani8-Jan-07 12:25
professionalRavi Bhavnani8-Jan-07 12:25 
GeneralRe: How create "always on bottom" apps? Pin
Stephen Hewitt8-Jan-07 15:42
Stephen Hewitt8-Jan-07 15:42 
GeneralRe: How create "always on bottom" apps? Pin
Ravi Bhavnani8-Jan-07 16:27
professionalRavi Bhavnani8-Jan-07 16:27 
QuestionWindows form and controls not handling focus properly Pin
likefood8-Jan-07 11:42
likefood8-Jan-07 11:42 
AnswerRe: Windows form and controls not handling focus properly Pin
likefood8-Jan-07 11:58
likefood8-Jan-07 11:58 
QuestionWindows closing itself in a thread Pin
suck1238-Jan-07 11:21
suck1238-Jan-07 11:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.