PC Review


Reply
Thread Tools Rate Thread

C++ typedef equivalent in C#

 
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      13th Jun 2006
Is there a C++ typedef equivalent in C#?

Thanks,
--
George
 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      13th Jun 2006
George <(E-Mail Removed)> wrote:
> Is there a C++ typedef equivalent in C#?


Not a "global" one, but you can use a using directive for a single
file:

using FooBar = System.String;

....

FooBar x = "Hello";

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
 
Reply With Quote
 
=?Utf-8?B?R2Vvcmdl?=
Guest
Posts: n/a
 
      13th Jun 2006
Thanks.

Unfortunately, I am hoping for a "global typedef" equivalent....
--
George


"Jon Skeet [C# MVP]" wrote:

> George <(E-Mail Removed)> wrote:
> > Is there a C++ typedef equivalent in C#?

>
> Not a "global" one, but you can use a using directive for a single
> file:
>
> using FooBar = System.String;
>
> ....
>
> FooBar x = "Hello";
>
> --
> Jon Skeet - <(E-Mail Removed)>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too
>

 
Reply With Quote
 
Mark Wilden
Guest
Posts: n/a
 
      13th Jun 2006
No problem -- just put it in an include file.

D'oh! Sometimes I miss C++. Not often, but sometimes.

///ark

"George" <(E-Mail Removed)> wrote in message
news:481BD011-A43F-4EBC-8370-(E-Mail Removed)...
> Thanks.
>
> Unfortunately, I am hoping for a "global typedef" equivalent....
> --
> George
>
>
> "Jon Skeet [C# MVP]" wrote:
>
>> George <(E-Mail Removed)> wrote:
>> > Is there a C++ typedef equivalent in C#?

>>
>> Not a "global" one, but you can use a using directive for a single
>> file:
>>
>> using FooBar = System.String;
>>
>> ....
>>
>> FooBar x = "Hello";
>>
>> --
>> Jon Skeet - <(E-Mail Removed)>
>> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
>> If replying to the group, please do not mail me too
>>



 
Reply With Quote
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      13th Jun 2006
Hi,

AFAIK this is not possible.
If you are going to create new files with this request you could define a
template and select it when selecting "Add new Item" from the project
explorer.



--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



"George" <(E-Mail Removed)> wrote in message
news:481BD011-A43F-4EBC-8370-(E-Mail Removed)...
> Thanks.
>
> Unfortunately, I am hoping for a "global typedef" equivalent....
> --
> George
>
>
> "Jon Skeet [C# MVP]" wrote:
>
>> George <(E-Mail Removed)> wrote:
>> > Is there a C++ typedef equivalent in C#?

>>
>> Not a "global" one, but you can use a using directive for a single
>> file:
>>
>> using FooBar = System.String;
>>
>> ....
>>
>> FooBar x = "Hello";
>>
>> --
>> Jon Skeet - <(E-Mail Removed)>
>> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
>> If replying to the group, please do not mail me too
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C's "typedef" into C# equivalent -- please help almurph@altavista.com Microsoft C# .NET 4 16th Jan 2009 02:00 PM
simple typedef equivalent in C# Greg Microsoft C# .NET 5 11th Jan 2007 11:32 PM
typedef Aleksey Microsoft C# .NET 2 6th Jul 2005 04:02 PM
Typedef Equivalent in .NET vvv Microsoft VB .NET 12 31st Dec 2003 01:31 PM
typedef Mr.Tickle Microsoft C# .NET 26 29th Sep 2003 07:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.