typedef Replacement?

J

Jonathan Wood

I would like some code to use a particular type of variable but have the
option to change it to another type of variable.

I assume I can use #define. Any chance there's a replacement for typedef?

Thanks.
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Jonathan said:
I would like some code to use a particular type of variable but have the
option to change it to another type of variable.

I assume I can use #define.
No.

Any chance there's a replacement for typedef?

Not really.

Using generics and polymorphism is probably your best choice.

Arne
 
G

Guest

You can use 'Imports' aliases.
e.g.,
Imports BigInt = System.Int64
....
Dim x As BigInt

But other developers will hate you since that's not what 'Imports' is
intended for.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 
G

Guest

Forgot which forum I was in....
In C#, you can do the following:
using BigInt = System.Int64;
....
BigInt x;

But, as I mentioned, other developers will despise you.
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 
G

Guest

Perhaps I meant 'shun' (or maybe they'll just dump garbage on your desk).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
Instant C++: converts C# or VB to C++/CLI
 
J

Jonathan Wood

Doesn't seem quite right, somehow, to use generics or polymorphism to define
simple integer data types.
 
J

Jonathan Wood

Thanks for the input.

I guess that's yet another item I must give up when moving from C++ to C#.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top