typedef - CSharp

This is a discussion on typedef - CSharp ; Hello, I am looking for the type C++ typedef equivalent in C#. Unfortunately, I couldn't find anything except using directive. Exp: using myId = int; However, this myId is only accessible in the file which is defined. Bu, I want ...

+ Reply to Thread
Results 1 to 2 of 2

typedef

  1. Default typedef

    Hello,

    I am looking for the type C++ typedef equivalent in C#. Unfortunately,
    I couldn't find anything except using directive. Exp:

    using myId = int;

    However, this myId is only accessible in the file which is defined.
    Bu, I want to use myId type also in another files without redefining.

    Any help would be greatly appreciated.

  2. Default Re: typedef

    On Dec 12, 1:58 pm, "ono...@gmail.com" <ono...@gmail.com> wrote:
    > I am looking for the type C++ typedef equivalent in C#. Unfortunately,
    > I couldn't find anything except using directive. Exp:
    >
    > using myId = int;
    >
    > However, this myId is only accessible in the file which is defined.
    > Bu, I want to use myId type also in another files without redefining.
    >
    > Any help would be greatly appreciated.


    No, there's no way of doing this. You could always create your own
    struct which *contains* an int, of course. If you're trying to use it
    as an identifier type, that would make a lot of sense, as a lot of
    integer operations really don't make sense on identifiers. What does
    it mean to divide one identifier by another, for example?

    Jon

+ Reply to Thread

Similar Threads

  1. Still no typedef
    By Application Development in forum Java
    Replies: 62
    Last Post: 12-25-2007, 05:19 PM
  2. typedef
    By Application Development in forum c++
    Replies: 4
    Last Post: 07-25-2007, 07:49 PM
  3. constuctor typedef
    By Application Development in forum c++
    Replies: 0
    Last Post: 02-23-2007, 04:51 PM
  4. What does this typedef mean?
    By Application Development in forum C
    Replies: 2
    Last Post: 08-21-2005, 12:48 AM
  5. typedef.....
    By Application Development in forum C
    Replies: 3
    Last Post: 05-28-2005, 04:17 AM