www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - class type definition problem

reply david <davidl 126.com> writes:
class A{
}
main()
{
   /+
   A b; //<------- this is ok before A is declared as a int variable
   +/
   int A;
   A b;  // actually i want b declared as class A. but d sees it as  
variable int A;
         // even if D think this would cause by mistaken programming, can D  
provide one way for
	  // us, like "class A b" to define b as Class A?

}
-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Aug 06 2006
parent Karen Lanrap <karen digitaldaemon.com> writes:
david wrote:

 can D provide one way for
 us, like "class A b" to define b as Class A?

There are at least two ways already: 1) module mod; ... mod.A b; ... 2) ... .A b; ...
Aug 06 2006