Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: Why multiselected text files don't open in more tabs Pin
Aljaz11127-May-09 15:25
Aljaz11127-May-09 15:25 
GeneralRe: Why multiselected text files don't open in more tabs Pin
Luc Pattyn27-May-09 15:33
sitebuilderLuc Pattyn27-May-09 15:33 
QuestionC++ to C# (struct) Pin
Mohammad Dayyan27-May-09 12:57
Mohammad Dayyan27-May-09 12:57 
AnswerRe: C++ to C# (struct) [not an answer] Pin
Colin Angus Mackay27-May-09 13:27
Colin Angus Mackay27-May-09 13:27 
GeneralRe: C++ to C# (struct) [not an answer] Pin
Mohammad Dayyan27-May-09 14:00
Mohammad Dayyan27-May-09 14:00 
GeneralRe: C++ to C# (struct) [not an answer] Pin
Colin Angus Mackay27-May-09 20:50
Colin Angus Mackay27-May-09 20:50 
AnswerRe: C++ to C# (struct) Pin
Adam Maras27-May-09 14:53
Adam Maras27-May-09 14:53 
AnswerRe: C++ to C# (struct) Pin
Jimmanuel27-May-09 14:54
Jimmanuel27-May-09 14:54 
the float and string member variables are straightforward and the struct should be a class in C# (unless you have good reason to use a struct). The tricky stuff comes after that.

This
chromo_typ(): bits(""), fitness(0.0f){};
is a constructor with minimal code formatting, here's an expanded version that's a bit easier on the eyes:
chromo_typ() : 
    bits(""), 
    fitness(0.0f)
{
};
That's a parameterless constructor with an initialization list (you can google that for more info). A very similar way of writing that constructor would be this:
chromo_typ()
{
    bits = "";
    fitness = "0.0f;
};
Now, in C++ there are subtles difference between those two versions of the function but for the purposes of the C++ -> C# conversion you needn't worry about them. This version of the function is another pretty straightforward conversion from one language to the other.

The second chromo_typ(...) line is just another constructor with some parameters. You should be able to convert that one the same way as the first Smile | :)


Badger | [badger,badger,badger,badger...]

QuestionThis is a performance issue: Struct vs. Class. Pin
Lecutus127-May-09 10:03
Lecutus127-May-09 10:03 
AnswerRe: This is a performance issue: Struct vs. Class. Pin
DaveyM6927-May-09 10:13
professionalDaveyM6927-May-09 10:13 
AnswerRe: This is a performance issue: Struct vs. Class. Pin
PIEBALDconsult27-May-09 10:20
mvePIEBALDconsult27-May-09 10:20 
AnswerRe: This is a performance issue: Struct vs. Class. Pin
harold aptroot27-May-09 10:22
harold aptroot27-May-09 10:22 
AnswerRe: This is a performance issue: Struct vs. Class. Pin
Luc Pattyn27-May-09 10:39
sitebuilderLuc Pattyn27-May-09 10:39 
AnswerRe: This is a performance issue: Struct vs. Class. Pin
Lecutus127-May-09 10:50
Lecutus127-May-09 10:50 
GeneralRe: This is a performance issue: Struct vs. Class. Pin
Luc Pattyn27-May-09 10:54
sitebuilderLuc Pattyn27-May-09 10:54 
QuestionHow to use cut function with selected tab of tabcontrol Pin
Aljaz11127-May-09 9:06
Aljaz11127-May-09 9:06 
AnswerRe: How to use cut function with selected tab of tabcontrol Pin
0x3c027-May-09 9:26
0x3c027-May-09 9:26 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
Aljaz11127-May-09 9:32
Aljaz11127-May-09 9:32 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
0x3c027-May-09 9:46
0x3c027-May-09 9:46 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
Troy Russell27-May-09 9:59
Troy Russell27-May-09 9:59 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
EliottA27-May-09 9:46
EliottA27-May-09 9:46 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
Aljaz11127-May-09 9:52
Aljaz11127-May-09 9:52 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
0x3c027-May-09 10:50
0x3c027-May-09 10:50 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
Aljaz11127-May-09 12:01
Aljaz11127-May-09 12:01 
GeneralRe: How to use cut function with selected tab of tabcontrol Pin
0x3c027-May-09 22:47
0x3c027-May-09 22:47 

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.