+ 1

What does 'public:' and '#define' do ??? In C++

examples if possible !!

9th Jan 2017, 9:32 PM
Siddharth Naithani
Siddharth Naithani - avatar
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; }
10th Jan 2017, 5:11 AM
Sachin Artani
Sachin Artani - avatar
+ 2
public makes a method public so it can be accessed from outside the class itself
9th Jan 2017, 10:01 PM
ein siedler
ein siedler - avatar