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 ...
-
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.
-
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
Similar Threads
-
By Application Development in forum Java
Replies: 62
Last Post: 12-25-2007, 05:19 PM
-
By Application Development in forum c++
Replies: 4
Last Post: 07-25-2007, 07:49 PM
-
By Application Development in forum c++
Replies: 0
Last Post: 02-23-2007, 04:51 PM
-
By Application Development in forum C
Replies: 2
Last Post: 08-21-2005, 12:48 AM
-
By Application Development in forum C
Replies: 3
Last Post: 05-28-2005, 04:17 AM