اريد ان اعرف هل حلي صح ام لا
فيه كود وعليه اسأله بس ما ادري اذا صح او لا
هذا السؤال
class strange ()
{
Private:
int a;
float b;
};a- Write a statement that shows the declaration in the class strange to overload the binary operator + as a friend function
b- Write a statement that shows the declaration in the class strange to overload the operator == as a friend function
c- Write a statement that shows the declaration in the class strange to overload the post-increment operator ++ as a friend function
الكود بعد الاجوبه
#include <iostream>
#include <cstdlib>
using namespace std;
class strange ()
{
private:
int a;
float b;
friend int operator+(strange &obj,int x);
friend bool operator ==(strange &obj);
friend strange operator++(int);
};

