CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011

    how to compile C function in C-Sharp program?


    I do not know how to code in C Sharp. I want to add a C function to an existing, working C Sharp program, and compile it. Let's say the C function is something like this:

    Test_Function ( )


    /* C codes go here. */


    What do I need to do to make this C Sharp program compile with the above test C function added? I tried adding standard C libraries at the top of the C Sharp program, but it won't compile.

    #include "stdio.h"
    #include "stdlib.h"
    #include "string.h"

    Please help. Thank you.

  2. #2
    Join Date
    May 2007

    Re: how to compile C function in C-Sharp program?

    You cannot mix two programming languages which require two different compilers inside the same project like that.
    www.monotorrent.com For all your .NET bittorrent needs

    NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.