Skip to content

Instantly share code, notes, and snippets.

@dibakarsutradhar
Created September 6, 2018 11:48
Show Gist options
  • Save dibakarsutradhar/ccf1d4c76cc8053ea694e2db6885475a to your computer and use it in GitHub Desktop.
Save dibakarsutradhar/ccf1d4c76cc8053ea694e2db6885475a to your computer and use it in GitHub Desktop.
#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