Click here to Skip to main content
15,891,253 members
Home / Discussions / C#
   

C#

 
GeneralRe: C++ to C# Pin
Mazdak22-Jul-03 1:46
Mazdak22-Jul-03 1:46 
GeneralRe: C++ to C# Pin
Ista22-Jul-03 3:56
Ista22-Jul-03 3:56 
GeneralRe: C++ to C# Pin
Meysam Mahfouzi22-Jul-03 1:46
Meysam Mahfouzi22-Jul-03 1:46 
GeneralRe: C++ to C# Pin
zoltan_ie22-Jul-03 1:49
zoltan_ie22-Jul-03 1:49 
GeneralRe: C++ to C# Pin
Meysam Mahfouzi22-Jul-03 1:58
Meysam Mahfouzi22-Jul-03 1:58 
GeneralRe: C++ to C# Pin
Frank Olorin Rizzi22-Jul-03 7:20
Frank Olorin Rizzi22-Jul-03 7:20 
GeneralRe: C++ to C# Pin
Jim Stewart22-Jul-03 2:50
Jim Stewart22-Jul-03 2:50 
GeneralRe: C++ to C# Pin
James T. Johnson22-Jul-03 8:10
James T. Johnson22-Jul-03 8:10 
Why keep it an int at all?

bool done = false;
 
...
 
if( done )
  break;
C doesn't have a concept of a boolean so you had to use some other data type to represent one, most code uses an int to hold a boolean value. C++ has bool datatype, but since the Win32 API is C based you typically don't use it favoring an int or the #defined BOOL.

Like C++, C# has a bool data type, unlike C++ though there isn't any legacy code to be aware of so you should use it whenever necessary.

[edit]And unlike C/C++, the bool datatype has a true/false value instead of a non-zero/zero value. So you need to assign true to done instead of a 1.

James

"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him

GeneralRe: C++ to C# Pin
Joe Woodbury22-Jul-03 8:16
professionalJoe Woodbury22-Jul-03 8:16 
GeneralKey Event Pin
don7cry22-Jul-03 0:43
don7cry22-Jul-03 0:43 
GeneralGDI+ FillPolygon Pin
r921-Jul-03 23:43
r921-Jul-03 23:43 
GeneralRe: GDI+ FillPolygon Pin
Valeria Bogdevich22-Jul-03 3:24
Valeria Bogdevich22-Jul-03 3:24 
GeneralRe: GDI+ FillPolygon Pin
r922-Jul-03 3:33
r922-Jul-03 3:33 
GeneralRe: GDI+ FillPolygon Pin
Valeria Bogdevich22-Jul-03 3:49
Valeria Bogdevich22-Jul-03 3:49 
GeneralRe: GDI+ FillPolygon Pin
r922-Jul-03 6:22
r922-Jul-03 6:22 
GeneralRe: GDI+ FillPolygon Pin
r922-Jul-03 21:54
r922-Jul-03 21:54 
GeneralRe: GDI+ FillPolygon Pin
Valeria Bogdevich23-Jul-03 7:57
Valeria Bogdevich23-Jul-03 7:57 
GeneralHiding a property in the Property Window Pin
Nick Seng21-Jul-03 20:59
Nick Seng21-Jul-03 20:59 
GeneralRe: Hiding a property in the Property Window Pin
J. Dunlap21-Jul-03 21:15
J. Dunlap21-Jul-03 21:15 
GeneralRe: Hiding a property in the Property Window Pin
Nick Seng21-Jul-03 21:27
Nick Seng21-Jul-03 21:27 
GeneralMultithreading Pin
Alberto Bencivenni21-Jul-03 20:53
Alberto Bencivenni21-Jul-03 20:53 
GeneralRe: Multithreading Pin
Julian Bucknall [MSFT]22-Jul-03 7:04
Julian Bucknall [MSFT]22-Jul-03 7:04 
GeneralRe: Multithreading Pin
Alberto Bencivenni22-Jul-03 21:24
Alberto Bencivenni22-Jul-03 21:24 
GeneralRe: Multithreading Pin
Julian Bucknall [MSFT]23-Jul-03 13:56
Julian Bucknall [MSFT]23-Jul-03 13:56 
GeneralRe: Multithreading Pin
Joe Woodbury22-Jul-03 8:28
professionalJoe Woodbury22-Jul-03 8:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.