Click here to Skip to main content
15,896,912 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: checking if a folder exists or not Pin
rbid20-May-06 21:38
rbid20-May-06 21:38 
AnswerRe: checking if a folder exists or not Pin
knoxplusplus23-May-06 7:26
knoxplusplus23-May-06 7:26 
QuestionRelevancy of C structures [modified] Pin
Sam Hobbs20-May-06 17:48
Sam Hobbs20-May-06 17:48 
AnswerRe: Relevancy of C structures [modified] Pin
bob1697220-May-06 18:36
bob1697220-May-06 18:36 
GeneralRe: Relevancy of C structures [modified] Pin
Sam Hobbs21-May-06 4:59
Sam Hobbs21-May-06 4:59 
GeneralRe: Relevancy of C structures [modified] Pin
bob1697221-May-06 15:57
bob1697221-May-06 15:57 
GeneralRe: Relevancy of C structures [modified] Pin
Sam Hobbs21-May-06 17:05
Sam Hobbs21-May-06 17:05 
AnswerRe: Relevancy of C structures [modified] Pin
James Brown20-May-06 23:48
James Brown20-May-06 23:48 
because the original-poster asked a question comparing struct+class, I would also limit my response to issues regarding C++ only - so you were right to state this.

The other posters were just trying to be helpful I think, unfortunately they were fairly inaccurate in their description of the C vs C++ issues regarding structs, especially 'andreas' who stated:

"As you can see they are different. That's because in C you are NOT defining a new data type with the definition of a structure. Therefore you need to add the keyword 'struct' in front of the name of the structure when you declare variables of it....In C++, however, a new type is defined when a structure is defined, and you can use this new type to declare variables, and the struct keyword is NOT needed."

this is incorrect, in both C and C++ you are defining a new type "struct name", and it must always be referred to as this. However C++ contains a bodge, and whenever you define a struct in this language it also installs an alias to that struct-type sharing the same name:

In C++ when you do this:
struct mystruct
{
};

It is really doing this (from a C point of view)
struct mystruct
{
};
typedef struct mystruct mystruct;




http://www.catch22.net

GeneralRe: Relevancy of C structures [modified] Pin
Sam Hobbs21-May-06 4:57
Sam Hobbs21-May-06 4:57 
QuestionScreen Recording Pin
CNewbie20-May-06 12:36
CNewbie20-May-06 12:36 
GeneralRe: Screen Recording Pin
User 171649220-May-06 13:04
professionalUser 171649220-May-06 13:04 
GeneralRe: Screen Recording Pin
CNewbie20-May-06 13:21
CNewbie20-May-06 13:21 
QuestionDoc-View and NewFile Pin
faroo2820-May-06 9:26
faroo2820-May-06 9:26 
AnswerRe: Doc-View and NewFile Pin
Neville Franks20-May-06 13:02
Neville Franks20-May-06 13:02 
GeneralRe: Doc-View and NewFile Pin
faroo2821-May-06 13:45
faroo2821-May-06 13:45 
Questionmd5? Pin
flyskytoday20-May-06 5:36
flyskytoday20-May-06 5:36 
AnswerRe: md5? Pin
Chris Losinger20-May-06 6:33
professionalChris Losinger20-May-06 6:33 
GeneralRe: md5? Pin
flyskytoday21-May-06 3:51
flyskytoday21-May-06 3:51 
QuestionExporting a struc from a DLL Pin
Cyber Friend20-May-06 4:23
Cyber Friend20-May-06 4:23 
AnswerRe: Exporting a struc from a DLL Pin
Cyber Friend20-May-06 6:28
Cyber Friend20-May-06 6:28 
QuestionSockets help Pin
Demian Panello20-May-06 4:08
Demian Panello20-May-06 4:08 
AnswerRe: Sockets help Pin
Laxman Auti20-May-06 4:25
Laxman Auti20-May-06 4:25 
GeneralRe: Sockets help Pin
Demian Panello20-May-06 7:24
Demian Panello20-May-06 7:24 
GeneralRe: Sockets help Pin
Laxman Auti21-May-06 18:38
Laxman Auti21-May-06 18:38 
QuestionCrash.... Pin
RockyJames20-May-06 2:52
RockyJames20-May-06 2:52 

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.