Connecting Tech Pros Worldwide Help | Site Map

inner classes allowed consrtuctors?

gara.matt@gmail.com
Guest
 
Posts: n/a
#1: Jul 18 '07
Hi,

Are nested/inner class allowed to have constructors?

When I try to compile something like

class A{

public:

class B{
public:
B(int a)
{ b =a;}

int b;
}

};


I get the error:

error: expected ',' or '...' before numeric constant on line "B(int
a)"

Sumit Rajan
Guest
 
Posts: n/a
#2: Jul 18 '07

re: inner classes allowed consrtuctors?


gara.matt@gmail.com wrote:
Quote:
Hi,
>
Are nested/inner class allowed to have constructors?
>
When I try to compile something like
>
class A{
>
public:
>
class B{
public:
B(int a)
{ b =a;}
>
int b;
}
Insert a ";" here.
Quote:
>
};
>
>
I get the error:
>
error: expected ',' or '...' before numeric constant on line "B(int
a)"
>
Hope that helps.

Regards,
Sumit.

--
Sumit Rajan <sumit.rajan@gmail.com>
Closed Thread