Message from C, C++ discussions

January 2020

— /warn It's C/C++ discussing here.

— 

That's 2/2 warnings; CristiCristiano is banned!
Reasons:
1: offtopic youtube not your video then it is not advertisment idk if it has ads but its youtube cuz i have autoblocker oh god i have to write my homework why do i spent time in this group trying to moderate it while just people broke rules and beg for homeworks and assigments in turbo cpp This is taking forever... it really makes you consider if you want to even be an admin... or even be alive... its a pity this happens.... Why do i even write this thing... i could just do /warn yt instead.... ah man life is hard... and other people will just throw sticticks and rocks at you.... like you do... why do you do it.... do you know it hurts???? it hurts so much.... but to this to be positive there is one inspiring quote i googled instead of googling someones assigment:
“I have not failed. I've just found 10,000 ways that won't work.”
― Thomas A. Edison
2: It's C/C++ discussing here.

— Welcome.

— `class base{
private:
base(const base &obj) {}
public:
base(){}

friend base fun(base &obj)
{
base nbj = obj;
return nbj;
}
};
int main(){
base obj;
fun(obj);
return 0;
}`

here copy constructor gets called from inside the friend function so it gets called without any problem

Message permanent page

— class base{
private:
base(const base &obj) {}
public:
base(){}

friend base fun(base &obj)
{
base nbj = obj;
return nbj;
}
};
int main(){
base obj;
fun(obj);
return 0;
}

Message permanent page

— How to format multiline?

— Just use formatting function from telegram. Select a text -> Right click -> Formatting -> Monospace.

— But, when I call the friend funtion and pass by value(copy constructor gets called) then why doesn't that work?

class base{
private:
base(const base &obj) {}
public:
base(){}

friend base fun(base obj)
{
base nbj = obj;
return nbj;
}
};
int main(){
base obj;
fun(obj);
return 0;
}


Doesn't call by value happen inside the friend function?

Message permanent page

— Does this even work? Copy assignmeny not defined

— No, it doesn't.

— /report

— Reported Sofia to admins.​​​​​​​​​​​​​​​