Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
How to access member function of a class using scope
//g++ 5.4.0 #include <iostream> using namespace std; class sq{ public: int a=6; int func(); }; int sq::func(){ return a*a; } int main() { class sq s; cout << "6 by 6 ="<<s.func(); }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Generating π from 1,000 random numbers
CPP - Pointers - Ex.1
Policy based smart pointer
Defining Class Members
kth smallest element in a matrix
BinTree playground
prime factorization trial division
12hours Clock c++
Gauss Jordan Ida
TemplateDoubly
Please log in to post a comment.