help me to pick up 2 sources

12/28/2011 21:36 pro4never#16
Quote:
Originally Posted by Mr_PoP View Post
NOT TRUE! mine does not use pointers at all , and all i can say it's decent enough ;P
Yours is not public...

Using pointers will (generally) provide increased performance or make the code easier to write/understand. It's a learning curve but there's no reason to completely avoid pointers like they are the anti christ. They exist for a reason and should be used where applicable.
12/28/2011 21:54 Mr_PoP#17
Quote:
Originally Posted by pro4never View Post
Yours is not public...

Using pointers will (generally) provide increased performance or make the code easier to write/understand. It's a learning curve but there's no reason to completely avoid pointers like they are the anti christ. They exist for a reason and should be used where applicable.
you didn't say public sources u said "Most decent C# sources still use pointers..." :P

and am completely avoiding pointers so i can run my source on any machine :)
12/28/2011 21:58 I don't have a username#18
Quote:
Originally Posted by Mr_PoP View Post
you didn't say public sources u said "Most decent C# sources still use pointers..." :P

and am completely avoiding pointers so i can run my source on any machine :)
Pointers are not machine based. A pointer is pointing to a location in the memory. Pointers are usually faster, because they write/read directly from memory. They aren't safe to use tho, because you can throw anything in them or whatever how you say it, that's why you use them in unsafe context in C#, but in C/C++ etc. you don't have to declare unsafe, because it's not safe anyways.
12/29/2011 00:19 Mr_PoP#19
Quote:
Originally Posted by I don't have a username View Post
Pointers are not machine based. A pointer is pointing to a location in the memory. Pointers are usually faster, because they write/read directly from memory. They aren't safe to use tho, because you can throw anything in them or whatever how you say it, that's why you use them in unsafe context in C#, but in C/C++ etc. you don't have to declare unsafe, because it's not safe anyways.
what i meant is if i used pointers, for instance i wont be able to run the source on Linux or so...!
12/29/2011 00:40 _tao4229_#20
Quote:
Originally Posted by Mr_PoP View Post
what i meant is if i used pointers, for instance i wont be able to run the source on Linux or so...!
Mono supports pointers as well.
12/29/2011 00:55 Mr_PoP#21
Quote:
Originally Posted by _tao4229_ View Post
Mono supports pointers as well.
as unknownone mentioned earlier....
Quote:
Originally Posted by unknownone View Post
You can run a C# server on mac/Linux via mono if you remove all the P/invokes, unsafe code and other platform specific code (specifically, BinaryReader/Writer, or other logic which does non-endian-aware conversion - assuming Mac on PPC).
12/29/2011 01:34 I don't have a username#22
Quote:
Originally Posted by Mr_PoP View Post
as unknownone mentioned earlier....
But are you using Mono? If yes, then you got a valid point, if no, then you have no reasons to not use pointers.
12/29/2011 01:50 Mr_PoP#23
Quote:
Originally Posted by I don't have a username View Post
But are you using Mono? If yes, then you got a valid point, if no, then you have no reasons to not use pointers.
atm of course am not, am using win7 lol , but what if i wanted to in the future!? then i will end up editing allot of stuff etc
12/29/2011 03:40 _tao4229_#24
Quote:
Originally Posted by Mr_PoP View Post
as unknownone mentioned earlier....
[Only registered and activated users can see links. Click Here To Register...]

Search for "unsafe" or "pointers."

They are supported. (Edit) As he said though, endian-ness is still a problem if you're running on a different architecture. And if you're doing packets the bitshift way, you've already screwed that one up.