Click here to Skip to main content
15,906,567 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C/C++ question - Function prototype in other function Pin
Naveen21-Oct-08 18:47
Naveen21-Oct-08 18:47 
GeneralRe: C/C++ question - Function prototype in other function Pin
Adeel Chaudhry21-Oct-08 19:37
Adeel Chaudhry21-Oct-08 19:37 
GeneralRe: C/C++ question - Function prototype in other function Pin
Naveen21-Oct-08 19:55
Naveen21-Oct-08 19:55 
Questionmac address libraries Pin
anilaabc21-Oct-08 17:26
anilaabc21-Oct-08 17:26 
AnswerRe: mac address libraries Pin
enhzflep21-Oct-08 18:41
enhzflep21-Oct-08 18:41 
QuestionWhat is the difference between c++ structs and c# structs..? Pin
Aslesh21-Oct-08 17:11
Aslesh21-Oct-08 17:11 
AnswerRe: What is the difference between c++ structs and c# structs..? Pin
Naveen21-Oct-08 18:39
Naveen21-Oct-08 18:39 
AnswerRe: What is the difference between c++ structs and c# structs..? Pin
Mark Salsbery21-Oct-08 18:58
Mark Salsbery21-Oct-08 18:58 
Structs are used in both languages to encapsulate related variables.

Structs differ between C++ and C# in how they compare with classes.

In C#, a struct is a value type, while a class is a reference type.

In the managed world, there are value types, which can be and most often are
stored on the stack (or as a member of a class) and reference types which are always
allocated on a heap. In C#, a struct is a value type, while a class is a reference type.
This is an important concept in C# - for example, when you pass a struct as a function parameter,
it is passed by value, so if the function changes the struct, the original passed object is
untouched. When a class object is passed it is by reference, so any changes made by the function
change the original object. That difference is why C# doesn't need *, &, and -> operators all
over the place.

In the native C++ world, structs and classes are the same except for default
member access. Both can be allocated on the stack or the heap. Reference and
value are controlled by operators, like *, &, ., and ->

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionRe: What is the difference between c++ structs and c# structs..? Pin
CPallini21-Oct-08 21:46
mveCPallini21-Oct-08 21:46 
AnswerRe: What is the difference between c++ structs and c# structs..? Pin
Iain Clarke, Warrior Programmer21-Oct-08 22:03
Iain Clarke, Warrior Programmer21-Oct-08 22:03 
GeneralRe: What is the difference between c++ structs and c# structs..? Pin
CPallini21-Oct-08 22:05
mveCPallini21-Oct-08 22:05 
QuestionHelp with code Pin
dtaylor0121-Oct-08 15:46
dtaylor0121-Oct-08 15:46 
AnswerRe: Help with code Pin
Naveen21-Oct-08 16:08
Naveen21-Oct-08 16:08 
AnswerRe: Help with code Pin
CPallini21-Oct-08 21:36
mveCPallini21-Oct-08 21:36 
AnswerRe: Help with code Pin
Iain Clarke, Warrior Programmer21-Oct-08 21:59
Iain Clarke, Warrior Programmer21-Oct-08 21:59 
QuestionLinker options Pin
freeheap21-Oct-08 9:08
freeheap21-Oct-08 9:08 
AnswerRe: Linker options Pin
Perspx21-Oct-08 9:51
Perspx21-Oct-08 9:51 
QuestionNeed help with mutex Pin
auralius manurung21-Oct-08 6:42
auralius manurung21-Oct-08 6:42 
AnswerRe: Need help with mutex Pin
Mark Salsbery21-Oct-08 6:56
Mark Salsbery21-Oct-08 6:56 
GeneralRe: Need help with mutex Pin
auralius manurung21-Oct-08 10:52
auralius manurung21-Oct-08 10:52 
GeneralRe: Need help with mutex Pin
Mark Salsbery21-Oct-08 11:06
Mark Salsbery21-Oct-08 11:06 
GeneralRe: Need help with mutex Pin
auralius manurung21-Oct-08 17:02
auralius manurung21-Oct-08 17:02 
GeneralRe: Need help with mutex [modified] Pin
Mark Salsbery21-Oct-08 18:17
Mark Salsbery21-Oct-08 18:17 
GeneralRe: Need help with mutex Pin
auralius manurung21-Oct-08 19:43
auralius manurung21-Oct-08 19:43 
GeneralRe: Need help with mutex Pin
Mark Salsbery21-Oct-08 20:06
Mark Salsbery21-Oct-08 20:06 

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.