Re: Like Typedef(In C++) operation what is option in C#.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Swapnil <Swapnil@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
we can use Typedef in C++ . To perform the same operation in C# How can i
use?
Please Explain with example.

There's no project-wide equivalent of typedef.

You can use using directives on a per file basis, e.g.

using FooBar = System.Console;

....

FooBar.WriteLine("Hi");

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.



Relevant Pages

  • Re: Like Typedef(In C++) operation what is option in C#.
    ... You can use using directives on a per file basis, ... using FooBar = System.Console; ... class MySpecialCollection: Dictionary{ ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problems using the strmbase.lib to write TransformFilter
    ... get to the same page: 'syntax error: missing identifier m_pString ... Open that file in your VS2005 IDE and see what PTCHAR* is resolving ... typedef WCHAR TCHAR, *PTCHAR; ... directives for your project, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Problems using the strmbase.lib to write TransformFilter
    ... Open that file in your VS2005 IDE and see what PTCHAR* is resolving ... typedef WCHAR TCHAR, *PTCHAR; ... typedef char TCHAR, *PTCHAR; ... directives for your project, ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: How do I do this in C#?
    ... >because it does alias types similar to a C++ typedef. ... You can keep copying using directives into ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How do I do this in C#?
    ... because it does alias types similar to a C++ typedef. ... multiple source files. ... You can keep copying using directives into ...
    (microsoft.public.dotnet.languages.csharp)