> Yes you can use pointers just fine - just use the "fixed" keyword.
Yes but be sure you *need* to. Writing unsafe code introduces stability and
security risks. I would make sure the framework doesn't offer the required
functionality out of the box first. If it doesn't perhaps you can rework the
algorithm without having to resort to unsafe code. Unsafe code should be the
last resort...
Regards
Lee
"Nick Hounsome" <Ne**@NickHounsome.Me.Uk> wrote in message
news:73******************@text.news.blueyonder.co. uk...
"Bjorn Abelli" <bj**********@DoNotSpam.hotmail.com> wrote in message
news:OG**************@TK2MSFTNGP02.phx.gbl...
"Marek" wrote... Hi, I'm developin windows forms app in c#.
I would like to use Ansi C algoritm in one of
method of my app. Can I do that?
That depends on what you really mean...
Yes, you should be able to use the *algorithm* from your Ansi C code,
though you probably will have to make some adjustments.
No, you can't just "cut and paste" Ansi C code into a C# source file,
unless it uses only primitive elements, no built in C-functions and no
pointers.
Yes you can use pointers just fine - just use the "fixed" keyword.
I have ported a CRC algorithm with almost no change - but there aren't
many algorithms that are complicated enough to want to port and yet don't
call a whole load of stuff that you can't use.
You can even call most C functions using P/Invoke - but it's a lot of
effort.