Last active
March 3, 2021 21:51
-
-
Save sim590/fa626243077e7b5c738384d25e446354 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "doubledecl.h" | |
namespace mon_name_space { | |
int maVariable = 0; | |
DoubleDecl::DoubleDecl() { | |
maVariable = 1; | |
} | |
int DoubleDecl::get() | |
{ | |
return maVariable; | |
} | |
} /* mon_name_space */ | |
int main(int argc, char *argv[]) | |
{ | |
mon_name_space::DoubleDecl d; | |
std::cout << d.get() << std::endl; | |
std::cout << mon_name_space::maVariable << std::endl; | |
return 0; | |
} | |
/* vim: set sts=4 ts=4 sw=4 tw=120 et :*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace mon_name_space { | |
class DoubleDecl { | |
public: | |
DoubleDecl (); | |
virtual ~DoubleDecl () {} | |
int get(); | |
private: | |
int maVariable; | |
}; | |
} /* mon_name_space */ | |
/* vim: set sts=4 ts=4 sw=4 tw=120 et :*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment