Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

System going down at 5 this afternoon to install scheduler bug.


devel / comp.lang.c++ / Re: a problem with an program

SubjectAuthor
o Re: a problem with an programDavid Brown

1
Re: a problem with an program

<uf9d08$uldu$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2009&group=comp.lang.c%2B%2B#2009

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: a problem with an program
Date: Sat, 30 Sep 2023 16:57:12 +0200
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <uf9d08$uldu$1@dont-email.me>
References: <fbfd5e3e-ccff-470d-b2b4-7090c1649e6an@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 30 Sep 2023 14:57:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c330df27e0489197c4726651b144e5a3";
logging-data="1004990"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RfxnrPiIq8TfxJ8bUSKb3dlbFjfUB5z0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:CHECC/PS5iGR6vFyzQ2HWzK+oiI=
Content-Language: en-GB
In-Reply-To: <fbfd5e3e-ccff-470d-b2b4-7090c1649e6an@googlegroups.com>
 by: David Brown - Sat, 30 Sep 2023 14:57 UTC

On 29/09/2023 21:59, karam hello wrote:
> i have a problem with this program using C++ OOP inheritance specially on class c:
> #include <iostream>
> using namespace std;
> class a{
> private:
> string name;
> int age;
> public:
> a(string n, int a){
> name = n;
> age = a;
> }
> };
> class b{
> private:
> string email;
> public:
> b(string em){
> email = em;
> }
> };
> class c:public a, public b{
> public:
> c(string n, int a, string em) : a(n, a), b(em){}
> };
> int main(){
> c c1("k", 10, "com");
> }

It looks like you are learning the language. I recommend getting in the
habit of using good names for your classes (and everything else), rather
than "a" or "b". Good naming makes code easier to write, and vastly
easier to read, and you should practice it from the start, even for
simple test code. See if it helps you out here.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor