473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

bool ./. Boolean


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

Nov 17 '05 #1
2 1026
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.

--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #2
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).
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: JKop | last post by:
Will the following print "NOT equal" on all implementations: #include <iostream> signed main() { bool k; k = 5;
19
by: daniel | last post by:
1) is C++ smart enough to automatically use "bits" for bool or will a bool have the size of a charcter (byte). 2) The index of a vector is it an integer (4 byte) or a "long long" with 8 bytes or...
16
by: raj | last post by:
Hi, I saw it mentioned that "int" is the fastest data-type for use in C ,that is data storage/retrieval would be the fastest if I use int among the following 4 situations in a 32 bit machine with...
0
by: Stanislav Simicek | last post by:
Hello, I've noticed that MC++ compiler (VS.NET 2003) marks "bool" type with MarshalAs(UnmanagedType.U1) attribute, even if System::Boolean is used. I would understand, why this happens for C++...
2
by: HL | last post by:
I am using VS2005 Beta2 In the VS.NET IDE, the Intellisense drop-down shows both bool and Boolean. What is the difference between the two? Similarly, it shows string and String ('s'...
6
by: zl2k | last post by:
hi, there I am using a big, sparse binary array (size of 256^3). The size may be changed in run time. I first thought about using the bitset but found its size is unchangeable. If I use the...
64
by: shaanxxx | last post by:
I have code which says #define MYBOOL int This code is very old. people who have written is not avaible. I was thinking what could be reason. 1) bool datatype was not available that time (10...
23
by: Saizan | last post by:
Why subclassing bool from int either __invert__ or __neg__ haven't been overrided to produce a boolean negation? I suspect backwards compatibility or something alike, but I still wonder.. And...
12
by: aaragon | last post by:
Hi All, I'm trying to print boolean values and after I searched the entire web, I couldn't find anything that does this =/ The code that I ended up using is as follows: string...
51
by: AommiK | last post by:
First of all: I love C and think that it's beautiful. However, there is at least one MAJOR flaw: the lack of a boolean type. OK. Some of you might refer to C99 and its _Bool (what's up with the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.