Connect with Facebook Lost Password?


Go Back   CodeCall Programming Forum > Software Development > C# Programming

C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-23-2006, 08:50 PM
Programming Professional
 
Join Date: Jun 2006
Posts: 205
Rep Power: 0
Chan is an unknown quantity at this point
Default Get and Set Functions

I don't really understand the GET and SET functions inside of a function. The functions go like this:

Code:
int somefunction() {
Get {
   return variable;
}

set {
   variable = this;
}
}
Where do you send the variable for set? When was this added? It seems like a neat way to create functions in classes and not have to create a new get/set function for everything.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-24-2006, 06:08 AM
Programmer
 
Join Date: May 2006
Posts: 193
Rep Power: 13
brackett is on a distinguished road
Default

I think you're describing Properties, but the syntax is a bit off. Instead of function someFunction, it'd be property someProperty.

The value in the set is implicit - it's what gets passed when you say object.someProperty = x; (x is the passed value).

It's cleaner than Java's getProperty, setProperty IMHO.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-24-2006, 10:06 PM
Kaabi
Guest
 
Posts: n/a
Default

Yes... Java is cleaner than C++ in some cases. >>... <<...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-25-2006, 11:44 AM
Programming God
 
Join Date: May 2006
Posts: 526
Rep Power: 15
NeedHelp is on a distinguished road
Default

You need these for properties, not functions. You have it wrong.
__________________
I Need Help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:15 PM.

Freelance Jobs

XML/XSL: Need code for Book with Chapers using XML
Create an XML file for a book of your creation, and a basic CSS file that will format it to display ...
Earn: $40.00


C++/C: Simple firework cue sequencer
What I require is a rework of a simple cue sequencer. I have a piece of hardware (an Arduino boar...
Earn: $50.00


HTML/XHTML: Menu Rework - ASCIIBin
I'm placing this in the HTML/XHTML section of the Freelance site but you are not limited to HTML. Wh...
Earn: $20.00



CodeCall Goal

Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%

Ads