codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  nested classes  amolg at 05:23 on Thursday, March 24, 2005
 

template <class T> class A{
class B{
T obj;
int a;
int b;
};
B * node;
public:
why_this(){
node = new B;
node -> a = 10;
node -> b = 20;
}
};


when I create object of template class inside nested class

it makes all other data members of that class
(here in this case class B) accessible to function

why_this();


where as if
class A{


class B{
int obj;
int a;
int b;
};
B * node;
public:
why(){
node = new B;
node -> a = 10;//error can not access
node -> b = 20;//can not access
}
};

why this happens?









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007