Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

bool ./. Boolean

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl - 23 Jun 2004 08:52 GMT
Hi,

is there a difference in using int or System.Int32 in C++ .NET ?
Or more general using the .NET Framework type instead of the C++ types ?
Performance ?
What's the best practice ?

Thanks
Carl
Tomas Restrepo \(MVP\) - 23 Jun 2004 11:56 GMT
Hi Carl,

> is there a difference in using int or System.Int32 in C++ .NET ?

Not generally, no. The only difference is when it involves pointers or
references (the .NET types by default imply __gc, while int,short, etc. by
default imply __nogc).

> Or more general using the .NET Framework type instead of the C++ types ?
> Performance ?
Nope.

> What's the best practice ?

Whatever one you like, as long as you understand what's going on.

Signature

Tomas Restrepo
tomasr@mvps.org

Phre2d - 25 Jun 2004 21:03 GMT
I have found the hard way that there is a difference in one situation:
if youare creating a .NET class library to be used by other languages
then your public methods should use Int16, Boolean and other such _gc
types.  If not, VB doesn't understand the parameter types in your
methods  (although VC++ and C# both understand int, short, long,
bool, etc. with no problems at all).

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.