Topic: accessibility
Author: _david_@axter.com
Date: Mon, 26 Mar 2001 06:38:13 GMT Raw View
In article <98gk8d$8mk$1@gavrilo.mtu.ru>, Sergei Antonov <sa@hash.ru>
writes:
>Hello!
>
>Can you please tell me if this code should compile according to the
>standard:
>
>class a
>{
>public:
> a() {}
>};
>
>class b:virtual a {};
>
>class c:b {} o;
>
>
>Borland compiler says "'a::a()' is not accessible in function c::c()", the
>others i've tried compiled this.
>
>--
>SA
>
>
>---
>[ comp.std.c++ is moderated. To submit articles, try just posting with ]
>[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
>[ --- Please see the FAQ before posting. --- ]
>[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
>
a::a() is a private member in class c.
It's a private member because you did not declare it other wise.
By default, all member are private, unless defined other wise.
To declare a::a() public, use the following syntax:
class c:public b {} o;
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: "Sergei Antonov" <sa@hash.ru>
Date: Mon, 12 Mar 2001 04:18:35 GMT Raw View
Hello!
Can you please tell me if this code should compile according to the
standard:
class a
{
public:
a() {}
};
class b:virtual a {};
class c:b {} o;
Borland compiler says "'a::a()' is not accessible in function c::c()", the
others i've tried compiled this.
--
SA
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]