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

C / C++ / MFC

 
AnswerRe: Error while adding ON_BN_CLICKED event. Pin
ThatsAlok25-Jul-10 23:56
ThatsAlok25-Jul-10 23:56 
GeneralRe: Error while adding ON_BN_CLICKED event. Pin
Deepu Antony26-Jul-10 0:07
Deepu Antony26-Jul-10 0:07 
AnswerRe: Error while adding ON_BN_CLICKED event. Pin
Cool_Dev26-Jul-10 0:30
Cool_Dev26-Jul-10 0:30 
Questionerror C2027 ? Pin
zon_cpp25-Jul-10 20:05
zon_cpp25-Jul-10 20:05 
AnswerRe: error C2027 ? PinPopular
«_Superman_»25-Jul-10 20:09
professional«_Superman_»25-Jul-10 20:09 
GeneralRe: error C2027 ? Pin
Peter_in_278025-Jul-10 21:07
professionalPeter_in_278025-Jul-10 21:07 
GeneralRe: error C2027 ? Pin
Richard MacCutchan25-Jul-10 22:44
mveRichard MacCutchan25-Jul-10 22:44 
GeneralRe: error C2027 ? [modified] Pin
Peter_in_278026-Jul-10 14:02
professionalPeter_in_278026-Jul-10 14:02 
Richard MacCutchan wrote:
Try it.


#include <iostream.h>
struct a {
	int aa;
	struct b *pb;
};
struct b {
	int bb;
	struct a *pa;
};

#pragma argsused
int main(int argc, char* argv[])
{
struct a *xa = new struct a;
struct b *xb = new struct b;
xa->pb = xb;
xa->pb->bb = 5;
cout << xb->bb;
return 0;
}

compiles and runs in my world. OK, so I'm not (M$) politically correct - I'm currently using Borland Turbo C++. I vaguely remember K&R or Stroustrup talking about this kind of forward reference - a pointer is as big as a pointer, regardless of what it points to, so all the compiler has to do is accept the implicit declaration.
btw, I don't want to get into a flame war about standards and compliance. Smile | :)

[edit][rant]However, I do think the 1-votes are unwarranted. Note that the OP's problem was *never* with the struct definitions, but turned out to be a typo in later reference. Two of you jumped down my throat. Personally, I don't give a flying, but the youngsters watching this might get the wrong impression.[/rant][/edit]
Software rusts. Simon Stephenson, ca 1994.
modified on Tuesday, July 27, 2010 12:39 AM

GeneralRe: error C2027 ? Pin
Richard MacCutchan26-Jul-10 22:44
mveRichard MacCutchan26-Jul-10 22:44 
GeneralRe: error C2027 ? PinPopular
ThatsAlok25-Jul-10 23:02
ThatsAlok25-Jul-10 23:02 
AnswerRe: error C2027 ? Pin
zon_cpp25-Jul-10 20:28
zon_cpp25-Jul-10 20:28 
QuestionExport to excel Pin
Amin.Abdi25-Jul-10 19:42
Amin.Abdi25-Jul-10 19:42 
AnswerRe: Export to excel Pin
ThatsAlok25-Jul-10 20:03
ThatsAlok25-Jul-10 20:03 
QuestionTab contol Issue. Pin
birajendu25-Jul-10 19:32
birajendu25-Jul-10 19:32 
QuestionDisable the close Button of a MFC Dockable Panes Pin
m_code25-Jul-10 11:45
m_code25-Jul-10 11:45 
QuestionwaveInOpen() problum?? Pin
AmbiguousName25-Jul-10 9:30
AmbiguousName25-Jul-10 9:30 
AnswerRe: waveInOpen() problum?? Pin
Luc Pattyn25-Jul-10 9:37
sitebuilderLuc Pattyn25-Jul-10 9:37 
GeneralRe: waveInOpen() problum?? Pin
AmbiguousName25-Jul-10 9:54
AmbiguousName25-Jul-10 9:54 
GeneralRe: waveInOpen() problum?? Pin
Luc Pattyn25-Jul-10 10:00
sitebuilderLuc Pattyn25-Jul-10 10:00 
GeneralRe: waveInOpen() problum?? Pin
AmbiguousName25-Jul-10 10:03
AmbiguousName25-Jul-10 10:03 
AnswerRe: waveInOpen() problum?? Pin
Luc Pattyn25-Jul-10 10:09
sitebuilderLuc Pattyn25-Jul-10 10:09 
GeneralRe: waveInOpen() problum?? Pin
AmbiguousName25-Jul-10 10:15
AmbiguousName25-Jul-10 10:15 
GeneralRe: waveInOpen() problum?? Pin
Luc Pattyn25-Jul-10 10:32
sitebuilderLuc Pattyn25-Jul-10 10:32 
GeneralRe: waveInOpen() problum?? Pin
AmbiguousName25-Jul-10 10:47
AmbiguousName25-Jul-10 10:47 
Questionfunny crash, do you know why? Pin
includeh1025-Jul-10 8:53
includeh1025-Jul-10 8:53 

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.