+ 1
What does 'public:' and '#define' do ??? In C++
examples if possible !!
2 odpowiedzi
+ 4
public is the access specifier which makes all the data member and member functions in a class to public means accessible everywhere.
#define is a macro used in C and C++ which predefines something.
eg.
#include<iostream.h>
#define pi=3.1416;
void main()
{
cout<<pi;
}
+ 2
public makes a method public so it can be accessed from outside the class itself