Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to reduce CPU uages with Opengl ? Pin
Cedric Moonen14-Feb-11 20:26
Cedric Moonen14-Feb-11 20:26 
QuestionNow I know why people use makefiles Pin
Craig Longman13-Feb-11 17:37
Craig Longman13-Feb-11 17:37 
GeneralRe: Now I know why people use makefiles Pin
Richard MacCutchan13-Feb-11 22:31
mveRichard MacCutchan13-Feb-11 22:31 
GeneralRe: Now I know why people use makefiles Pin
Craig Longman14-Feb-11 2:54
Craig Longman14-Feb-11 2:54 
GeneralRe: Now I know why people use makefiles Pin
Richard MacCutchan14-Feb-11 5:01
mveRichard MacCutchan14-Feb-11 5:01 
GeneralRe: Now I know why people use makefiles Pin
Craig Longman14-Feb-11 13:01
Craig Longman14-Feb-11 13:01 
AnswerRe: Now I know why people use makefiles Pin
Joe Woodbury14-Feb-11 12:34
professionalJoe Woodbury14-Feb-11 12:34 
QuestionNested structs problem [modified] Pin
manchukuo13-Feb-11 10:07
manchukuo13-Feb-11 10:07 
Hi there i am currently facing this problem. I use forward declaration to declare both structs but when doing an assignment to the struct it complains that is undefined.Ex. i have this structs:

struct A;
struct B;

struct A
{
  int lolipops;
  B* candy;

  A(B* ptr)
  {
   lolipops = 0;
   candy = ptr;
  }

  action(int pass)
  {
    candy->gums = pass;//this is where i get the error of undefined type 'B'
  }
};

struct B{
 int gums;
 A* candy;
 
 B(A* ptr)
 {
  gums = 0;
  candy = ptr;
 }

 action(int pass)
 {
   candy->lolipops = pass;//this is where i get the error of undefined type 'A'
 }
};



This is a sample not used currently by me but it ilustrates the problem. Can someone tell me what is wrong?

modified on Sunday, February 13, 2011 4:54 PM

AnswerRe: Nested structs problem [modified] Pin
Richard MacCutchan13-Feb-11 10:39
mveRichard MacCutchan13-Feb-11 10:39 
GeneralRe: Nested structs problem Pin
manchukuo13-Feb-11 10:58
manchukuo13-Feb-11 10:58 
GeneralRe: Nested structs problem Pin
Richard MacCutchan13-Feb-11 11:40
mveRichard MacCutchan13-Feb-11 11:40 
AnswerRe: Nested structs problem Pin
Luc Pattyn13-Feb-11 11:05
sitebuilderLuc Pattyn13-Feb-11 11:05 
GeneralRe: Nested structs problem Pin
manchukuo13-Feb-11 11:08
manchukuo13-Feb-11 11:08 
AnswerRe: Nested structs problem Pin
Luc Pattyn13-Feb-11 11:11
sitebuilderLuc Pattyn13-Feb-11 11:11 
AnswerRe: Nested structs problem Pin
Niklas L13-Feb-11 11:24
Niklas L13-Feb-11 11:24 
GeneralRe: Nested structs problem Pin
Richard MacCutchan13-Feb-11 11:41
mveRichard MacCutchan13-Feb-11 11:41 
GeneralRe: Nested structs problem [modified] Pin
Niklas L13-Feb-11 11:52
Niklas L13-Feb-11 11:52 
GeneralRe: Nested structs problem Pin
manchukuo13-Feb-11 12:39
manchukuo13-Feb-11 12:39 
GeneralRe: Nested structs problem Pin
Richard MacCutchan13-Feb-11 13:33
mveRichard MacCutchan13-Feb-11 13:33 
GeneralRe: Nested structs problem Pin
manchukuo13-Feb-11 15:13
manchukuo13-Feb-11 15:13 
GeneralRe: Nested structs problem Pin
Niklas L13-Feb-11 21:04
Niklas L13-Feb-11 21:04 
GeneralRe: Nested structs problem Pin
manchukuo14-Feb-11 12:44
manchukuo14-Feb-11 12:44 
GeneralRe: Nested structs problem Pin
Stefan_Lang14-Feb-11 0:19
Stefan_Lang14-Feb-11 0:19 
GeneralRe: Nested structs problem Pin
manchukuo14-Feb-11 12:48
manchukuo14-Feb-11 12:48 
GeneralRe: Nested structs problem Pin
Richard MacCutchan13-Feb-11 13:28
mveRichard MacCutchan13-Feb-11 13: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.