Click here to Skip to main content
15,900,725 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: casting size_t to unsigned int : data loss possible ?! Pin
toxcct14-Sep-06 0:09
toxcct14-Sep-06 0:09 
GeneralRe: casting size_t to unsigned int : data loss possible ?! Pin
Nibu babu thomas14-Sep-06 0:13
Nibu babu thomas14-Sep-06 0:13 
GeneralRe: casting size_t to unsigned int : data loss possible ?! Pin
Mr.Brainley14-Sep-06 0:18
Mr.Brainley14-Sep-06 0:18 
AnswerRe: casting size_t to unsigned int : data loss possible ?! Pin
cmk14-Sep-06 5:51
cmk14-Sep-06 5:51 
Questionproblem with classes interaction Pin
singersinger13-Sep-06 23:34
singersinger13-Sep-06 23:34 
AnswerRe: problem with classes interaction Pin
Nibu babu thomas13-Sep-06 23:38
Nibu babu thomas13-Sep-06 23:38 
AnswerRe: problem with classes interaction Pin
wheelerbarry13-Sep-06 23:46
wheelerbarry13-Sep-06 23:46 
GeneralRe: problem with classes interaction Pin
Maximilien14-Sep-06 2:45
Maximilien14-Sep-06 2:45 
wheelerbarry wrote:
class A;

#inlcude "B.h"

class A
{ B* b;};


with this, you will have include problems.

in B.h you will need to have include guards

 // B.h
#ifndef _B_H_
#define _B_H_
class B
{
  // ...
};
#endif


and in A.h it is good practice ( IMO, YMMV ) to also add include guards :

 // A.h
#ifndef _A_H_
#define _A_H_

#ifndef _B_H_
  #include "b.h"
#endif

class A
{
  B* b;
};
#endif


IMO, using forward declaration is the best approach to that problem unless B is not a pointer.



Maximilien Lincourt
Your Head A Splode - Strong Bad

AnswerRe: problem with classes interaction Pin
singersinger14-Sep-06 1:04
singersinger14-Sep-06 1:04 
AnswerRe: problem with classes interaction Pin
David Crow14-Sep-06 3:09
David Crow14-Sep-06 3:09 
QuestionWindow regions Pin
Waldermort13-Sep-06 23:31
Waldermort13-Sep-06 23:31 
AnswerRe: Window regions Pin
Nibu babu thomas13-Sep-06 23:45
Nibu babu thomas13-Sep-06 23:45 
GeneralRe: Window regions Pin
Waldermort14-Sep-06 0:02
Waldermort14-Sep-06 0:02 
GeneralRe: Window regions Pin
Waldermort14-Sep-06 0:16
Waldermort14-Sep-06 0:16 
GeneralRe: Window regions Pin
Nibu babu thomas14-Sep-06 0:25
Nibu babu thomas14-Sep-06 0:25 
Questionc++ compiler (64 bit) [modified] Pin
hiral_shah13-Sep-06 23:26
hiral_shah13-Sep-06 23:26 
AnswerRe: c++ compiler (64 bit) Pin
Christian Graus13-Sep-06 23:31
protectorChristian Graus13-Sep-06 23:31 
GeneralRe: c++ compiler (64 bit) Pin
hiral_shah13-Sep-06 23:52
hiral_shah13-Sep-06 23:52 
GeneralRe: c++ compiler (64 bit) [modified] Pin
Sarath C14-Sep-06 0:12
Sarath C14-Sep-06 0:12 
GeneralRe: c++ compiler (64 bit) Pin
Sarath C14-Sep-06 0:14
Sarath C14-Sep-06 0:14 
GeneralRe: c++ compiler (64 bit) Pin
Zac Howland14-Sep-06 4:13
Zac Howland14-Sep-06 4:13 
AnswerRe: c++ compiler (64 bit) Pin
Mike Dimmick13-Sep-06 23:55
Mike Dimmick13-Sep-06 23:55 
GeneralRe: c++ compiler (64 bit) Pin
hiral_shah14-Sep-06 0:03
hiral_shah14-Sep-06 0:03 
GeneralRe: c++ compiler (64 bit) Pin
Sarath C14-Sep-06 0:21
Sarath C14-Sep-06 0:21 
AnswerRe: c++ compiler (64 bit) Pin
Anna-Jayne Metcalfe14-Sep-06 0:14
Anna-Jayne Metcalfe14-Sep-06 0:14 

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.