C# anyone? - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: C# anyone? (/showthread.php?tid=97872) C# anyone? by Chancer on 06-25-2011 at 01:32 AM
I'm starting to learn C# (by my own, so far, with a teacher soon). C# code:I also want to store a string, representing the client name, for example. Is that possible? I thought of creating a new structure ("transcoding" what I learned on C), but I'd need to use pointers, and I read somewhere C# has no pointers... Edit: reading the reference on MSDN I found a Dictionary. Do you think replacing the linked list by the dictionary would work? The methods I need are Add, RemoveFirst, Cound and I also use: C# code: I'm afraid it's not possible due to this: C# code:I don't think I can remove one element without telling which on, right? RE: C# anyone? by Mnjul on 06-25-2011 at 09:43 AM
You can't do a RemoveFirst on a Dictionary. RE: C# anyone? by Chancer on 06-25-2011 at 04:39 PM
Very interesting. I'll try that later. RE: C# anyone? by Adeptus on 06-28-2011 at 04:08 AM
There is no reason why you can't use LinkedList with your own class that holds the Socket and whatever additional item(s) you want. RE: C# anyone? by Chancer on 06-28-2011 at 07:18 PM
Interesting. Actually, since it's the first time I'm using an object-oriented language (I've "used" Python once, but I don't think that counts), this things of classes, methods, events, they are still a bit messed in my head. C code:next and prev were my problem on C#. It's easy with C pointers and I wanted to know if I could do that on C#. After reading that page I'm still not sure, maybe I'll give it a try later. But I bet using ref will be useful when I effectively start coding. Thanks. And about my program, turns out that I was using RemoveFirst to clean the whole list, so I was able to use a Dictionary and it's method Clean. In the end, I have a Chat server and client (like chatting online in the 90's ), with some limitations, but I really liked the interface (everything I had coded until now was console-apps). Too bad no one is going to use it |