Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
NamespaceId
//g++ 7.4.0 //NamespaceId //this code is created by Rezaul Hoque on January 03,2022;contact: jewelmrh@yahoo.com,Dhaka, Bangladesh //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; #include <iostream> #include <string> namespace Name{ class Name{ public: Name(std::string s){n=s;} std::string getName() { return n;} std::string n; }; } namespace Id{ class Iden{ public: Iden(int a){ b=a;} int getId() { return b;} int b; }; } namespace Address{ class Ad{ public: Ad(std::string s){n=s;} std::string getAd() { return n;} std::string n; }; } int main() { std::string s1,s2; int x; s1= "rrr"; s2 = "bbb"; x=578; Name::Name name(s1); Id::Iden id(x); Address::Ad ad(s2); std::cout<<name.getName()<<"\n"<<id.getId()<<"\n"<<ad.getAd(); return 0; }
run
|
edit
|
history
|
help
0
Dictionary
Jilebi Nimki
Listas enlazadas - dividir lista en dos reutilizando nodos
test111
Optimization Lab 2
ExceptInviteClass
sin_approximation
Dar
Привет Linux
VectorNormFn