Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Problems with File Pin
OriginalGriff12-Dec-12 5:23
mveOriginalGriff12-Dec-12 5:23 
Questionproblem with using pointers in C# Pin
siawash_s12-Dec-12 4:38
siawash_s12-Dec-12 4:38 
AnswerRe: problem with using pointers in C# Pin
Eddy Vluggen12-Dec-12 4:44
professionalEddy Vluggen12-Dec-12 4:44 
GeneralRe: problem with using pointers in C# Pin
siawash_s13-Dec-12 1:09
siawash_s13-Dec-12 1:09 
AnswerRe: problem with using pointers in C# Pin
Abhinav S12-Dec-12 5:04
Abhinav S12-Dec-12 5:04 
AnswerRe: problem with using pointers in C# Pin
OriginalGriff12-Dec-12 5:06
mveOriginalGriff12-Dec-12 5:06 
AnswerRe: problem with using pointers in C# Pin
DaveyM6912-Dec-12 8:08
professionalDaveyM6912-Dec-12 8:08 
AnswerRe: problem with using pointers in C# Pin
trønderen12-Dec-12 10:57
trønderen12-Dec-12 10:57 
I doubt that your real need it to use pointers. Your need is to solve a problem that requires you to use pointers in languages like C and Pascal. That doesn't mean you need to use pointers in other languages.

In C#, every object is implicitly referenced through a "pointer" (which isn't a memory address, but an object reference). Say, to build a directed tree in a brother/son fashion, you declare your "myObject" class defines members "brother" and "son", both of class "myObj". Their values are not stored in the current node; the current node refers to ("has pointers to") the brother and son. There is no syntactical indication of this, because it is always so for class members.

Atomic members such as int and bool do reside in the class object, object members never do. You must be aware of this distinction - e.g. if you use the int member "age" as a method argument (without modifiers), a copy is provided to the method, but if you use "brother" as an argument, a reference ("pointer") is provided, not an object copy.

If you do not want to sent a copy of a single int, but a reference, you can use the Int class, which behaves just like your myObject instances: A reference is passed, not a copy of the value. But note that you don't need to use Int objects for allowing a method to change a parameter; you can add the modifier "ref" (or "out") to it, but you must add "ref"/"out" both in the formal declaration of the method and everywhere it is invoked.

The only time you need to handle pointers in C# is when interacting with unmanaged code, e.g. for a number of Windows system calls that are not directly available in C#. But you should avoid "using" pointers as much as possible: Treat them as opaque handles. Above all: Stay completely away from doing arithmetics on pointers! (Those who know what can and can't be done in that area need not ask questions about pointers in C#... Smile | :) )
QuestionValue of label is not changing upon loading or changing the value of the combobox Pin
jon-8012-Dec-12 4:37
professionaljon-8012-Dec-12 4:37 
AnswerRe: Value of label is not changing upon loading or changing the value of the combobox Pin
Eddy Vluggen12-Dec-12 4:42
professionalEddy Vluggen12-Dec-12 4:42 
AnswerRe: Value of label is not changing upon loading or changing the value of the combobox Pin
Freak3012-Dec-12 4:52
Freak3012-Dec-12 4:52 
QuestionApply diff image on the original image c# Pin
Tridip Bhattacharjee12-Dec-12 0:22
professionalTridip Bhattacharjee12-Dec-12 0:22 
QuestionTwo image compare using win32 api c# Pin
Tridip Bhattacharjee12-Dec-12 0:21
professionalTridip Bhattacharjee12-Dec-12 0:21 
AnswerRe: Two image compare using win32 api c# Pin
Pete O'Hanlon12-Dec-12 1:01
mvePete O'Hanlon12-Dec-12 1:01 
QuestionCode does not appear to be called when program is run Pin
bikerben12-Dec-12 0:07
bikerben12-Dec-12 0:07 
AnswerRe: Code does not appear to be called when program is run Pin
Pete O'Hanlon12-Dec-12 1:06
mvePete O'Hanlon12-Dec-12 1:06 
GeneralRe: Code does not appear to be called when program is run Pin
bikerben12-Dec-12 1:23
bikerben12-Dec-12 1:23 
GeneralRe: Code does not appear to be called when program is run Pin
Pete O'Hanlon12-Dec-12 2:25
mvePete O'Hanlon12-Dec-12 2:25 
SuggestionRe: Code does not appear to be called when program is run Pin
Richard MacCutchan12-Dec-12 3:07
mveRichard MacCutchan12-Dec-12 3:07 
GeneralRe: Code does not appear to be called when program is run Pin
bikerben12-Dec-12 3:12
bikerben12-Dec-12 3:12 
GeneralRe: Code does not appear to be called when program is run Pin
Alan N12-Dec-12 3:07
Alan N12-Dec-12 3:07 
QuestionTFS and WIX Pin
Pascal Ganaye11-Dec-12 22:33
Pascal Ganaye11-Dec-12 22:33 
QuestionCanny edge detection in c# Pin
neha198711-Dec-12 22:11
neha198711-Dec-12 22:11 
AnswerRe: Canny edge detection in c# Pin
Simon_Whale11-Dec-12 22:23
Simon_Whale11-Dec-12 22:23 
AnswerRe: Canny edge detection in c# Pin
Pete O'Hanlon11-Dec-12 22:34
mvePete O'Hanlon11-Dec-12 22:34 

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.