Skip to content

Instantly share code, notes, and snippets.

@AungWinnHtut
Created August 1, 2016 14:53
Show Gist options
  • Save AungWinnHtut/136150b8100c93d726a990573606607c to your computer and use it in GitHub Desktop.
Save AungWinnHtut/136150b8100c93d726a990573606607c to your computer and use it in GitHub Desktop.
test cpp
#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