Created
August 1, 2016 14:53
-
-
Save AungWinnHtut/136150b8100c93d726a990573606607c to your computer and use it in GitHub Desktop.
test cpp
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> | |
#include<string> | |
using namespace std; | |
class Distance | |
{ | |
private: | |
int feet; | |
float inches; | |
public: | |
void getdist() | |
{ | |
cout<<"\nEnter feet"; | |
cin>>feet;//>>inches; | |
cout<<"\nEnter inches"; | |
cin>>inches; | |
//return 0; | |
} | |
void showdist() | |
{ | |
cout<<"\n"<<feet<<"\' "<<inches<<"\" "; | |
} | |
}; | |
int main() | |
{ | |
Distance d1; | |
d1.getdist(); | |
d1.showdist(); | |
Distance* distptr; | |
distptr->getdist(); | |
distptr->showdist(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment