LoL History repeats itself. Maybe that's a dejavu for you, only for you...
Type: Posts; User: freakyboard
LoL History repeats itself. Maybe that's a dejavu for you, only for you...
Data members of the classes have to be private. I'm trying to learn about friend functions.
//---------------------------------------------------------------------------
#include <vcl.h>
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<conio.h>
using namespace std;...
If you are interested in, I can post the whole code. It's really long.
There is an answer coz it's an exam question. I made the code smaller for you.
Somebody told me about friend functions. What about friend functions?
We are not allowed to use those functions in main().
We can't use those functions in main() so how can we call them?
That's easy for me. I had created more and more like those functions GetA, SetA... They didn't work.
int& x::GetA(){return a;}
void x::SetA(){cout<<"Enter the value of a: "; cin>>a; }
OR ...
Elysia, can you help me more?
Coz I typed k.a not k.a() so we can't call it.
class x{int a;};
class y:public x{};
main(){y k; k.a=3; }
How can I access "k.a"?
PS: You can't change or omit any part of the code.
a have to be private.
Member access specifier...