From 61ca7e182e879107ff38db3709fc0934363d6c89 Mon Sep 17 00:00:00 2001 From: AkshatGoyal <58101087+AkshatGoyal1018@users.noreply.github.com> Date: Tue, 21 Apr 2020 11:01:26 +0530 Subject: [PATCH] program to demonstrate class functions of class are defined outside the class --- class1.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 class1.cpp diff --git a/class1.cpp b/class1.cpp new file mode 100644 index 0000000..2ec5d64 --- /dev/null +++ b/class1.cpp @@ -0,0 +1,29 @@ +#include +using namespace std; +class person +{ + char name[30]; + int a; + public: + void getdata(); + void display(); +}; +void person:: getdata() +{ + cout<<"enter name"<>name; + cout<<"enter age"<>a; +} +void person:: display() +{ + cout<<"\nName:"<