Created
September 6, 2018 11:48
-
-
Save dibakarsutradhar/ccf1d4c76cc8053ea694e2db6885475a to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
using namespace std; | |
class printInfo { | |
public: | |
void print(int i){ | |
cout << "Int: " << i << endl; | |
} | |
void print(double j){ | |
cout << "Double: " << j << endl; | |
} | |
void print(char* k){ | |
cout << "Character: " << k << endl; | |
} | |
}; | |
int main(void){ | |
printInfo numbers; | |
// printing int value | |
numbers.print(2); | |
// printing double value | |
numbers.print(20.202); | |
// printing char value | |
numbers.print("Likhe felechi"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment