|
You last visited: Today at 15:43
Advertisement
help me to pick up 2 sources
Discussion on help me to pick up 2 sources within the CO2 Private Server forum part of the Conquer Online 2 category.
12/28/2011, 21:36
|
#16
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
|
Quote:
Originally Posted by Mr_PoP
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
|
#17
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by pro4never
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
|
#18
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
Quote:
Originally Posted by Mr_PoP
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
|
#19
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by I don't have a username
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
|
#20
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by Mr_PoP
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
|
#21
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by _tao4229_
Mono supports pointers as well.
|
as unknownone mentioned earlier....
Quote:
Originally Posted by unknownone
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
|
#22
|
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
|
Quote:
Originally Posted by Mr_PoP
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
|
#23
|
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
|
Quote:
Originally Posted by I don't have a username
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
|
#24
|
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
|
Quote:
Originally Posted by Mr_PoP
as unknownone mentioned earlier....
|
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.
|
|
|
All times are GMT +2. The time now is 15:43.
|
|