ctacke/>
Wed Aug 17 06:21:17 CDT 2005
C# does support passing pointers as parameters, but again, you've not give
solid reasoning. The CollectionBase namespace has linked lists without the
need for unsafe, difficult to read, difficult to maintain code. If you
insist on it, at least post a real, working example of the failure, not some
snippet that we'd have to write more code for.
-Chris
"Naveen koul" <Naveenkoul@discussions.microsoft.com> wrote in message
news:38CD9AE0-A214-48D2-8082-4F2689C7869F@microsoft.com...
>
> hi,
>
> this is just an sample code i have put here so that i get an idea how to
> get
> this code working.
> I have alredy an code in EVC++4.2 working and now i am trying to port it
> to
> c#.my most of the code got working , but now when i am trying to create a
> dll, this is were i am getting a problem.this code is just of the linked
> list.
>
> Regards
>
> Naveen
> "Chris Tacke, eMVP" wrote:
>
>> I've done plenty of pointer parameter work - but it's rare that it's
>> necessary. Here I'm not convinced, plus you've not give un enough to
>> replicate the problem.
>>
>> --
>> Chris Tacke
>> Co-founder
>> OpenNETCF.org
>> Are you using the SDF? Let's do a case study.
>> Email us at d c s @ o p e n n e t c f . c o m
>>
http://www.opennetcf.org/donate
>>
>>
>> "Naveen koul" <Naveenkoul@discussions.microsoft.com> wrote in message
>> news:18FDAEB6-CAC4-49C4-9B2F-2330601ADA4F@microsoft.com...
>> > hi,
>> >
>> > i was trying to write a c# code , were i need to pass ponitrtas an
>> > functin
>> > argument . but when ever i am trying to do it i am getting error
>> >
>> > "Cannot take the address or size of a variable of a managed type"
>> >
>> > I am writing a piece of code were in which i am getting it can ayone
>> > help
>> > me
>> > to remove it.
>> > //////////////////////////////////////////////////////////////////////////////////////////////////////////
>> >
>> >
>> > public unsafe class Node
>> > {
>> > public unsafe Node *pr;
>> > public unsafe Node *ne;
>> > }
>> > ***********************************************************
>> > public unsafeclass Element : Node
>> > {
>> >
>> > public unsafe Element *fist;
>> > public unsafe Element *lst;
>> > public int length;
>> >
>> > }
>> > public unsafe void adBefore(Element *ptr, Element *pce)
>> > {
>> >
>> > {
>> > ptr->pr=pce->pr;
>> > if (pce->pr!=null)
>> > pce->pr->ne=ptr; else
>> > fist=ptr;
>> > pce->pr=ptr;
>> > ptr->ne=pce;
>> > length++;
>> > }
>> > }
>> >
>> >
>> > };
>> > ////////////////////////////////////////////////////////////////////////////////////////////////////
>> >
>> > Hope anyone will provide a soln to me regarding this problem.
>> >
>> > waiting for reply eagerly.
>> >
>> > Regards
>> >
>> > Naveen
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>>