locked
Converting C++ typedefs to C# RRS feed

  • Question

  • How do I convert a typedef in C++ to the appropriate C# format. Here is my C++ example.

    typedef int16_t csharp_int16;
    

    I have tried the following, but when I reference csharp_int16 it cannot be found when I build the program.

    using csharp_int16 = Int16;

    Thanks for any advice.

    Mike

     

    Sunday, April 11, 2010 5:26 PM

Answers

  • Try using the full name

    using csharp_int16 = System.Int16;

    This should work

    • Marked as answer by mihooper1 Sunday, April 11, 2010 5:56 PM
    Sunday, April 11, 2010 5:34 PM

All replies

  • Try using the full name

    using csharp_int16 = System.Int16;

    This should work

    • Marked as answer by mihooper1 Sunday, April 11, 2010 5:56 PM
    Sunday, April 11, 2010 5:34 PM
  • In most cases a C++ 'typedef' is merely declaring an alias name for an existing type.

    In your example, whenever the type name "csharp_int16" is used, the type "int16_t" will be used.


    Mark the best replies as answers. "Fooling computers since 1971."
    Sunday, April 11, 2010 5:35 PM
    Moderator
  • Thanks Sherif. This worked!
    Sunday, April 11, 2010 5:57 PM
  • Thanks for the clarification Rudy.
    Sunday, April 11, 2010 5:57 PM
  • Thanks for the clarification Rudy.
    Sunday, April 11, 2010 5:57 PM