Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- class HelloWorldApp {public: HelloWorldApp(); virtual ~HelloWorldApp(); void Generate(); void Write(); private: char text[13];}; HelloWorldApp::HelloWorldApp() {this->Generate();} HelloWorldApp::~HelloWorldApp() {delete this->text;} void HelloWorldApp::Generate() {int index = 0; while (index < 13) {switch (index) {case 0: this->text[index] = 'H'; break; case 1: this->text[index] = 'e'; break; case 2: this->text[index] = 'l'; break; case 3: this->text[index] = 'l'; break; case 4: this->text[index] = 'o'; break; case 5: this->text[index] = ','; break; case 6: this->text[index] = ' '; break; case 7: this->text[index] = 'w'; break; case 8: this->text[index] = 'o'; break; case 9: this->text[index] = 'r'; break; case 10: this->text[index] = 'l'; break; case 11: this->text[index] = 'd'; break; case 12: this->text[index] = '!'; break;} index++;}} void HelloWorldApp::Write() {int index = 0; while (index < 13) {std::cout << this->text[index]; index++;} std::cout << std::endl;} int main(int argc, char* argv[]) {HelloWorldApp* app = new HelloWorldApp(); app->Write(); return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement