class - Simple program [HELP] c++ -
hey guys please tell me wrong program. doesn't output desired output. glad if explain me why doesn't show errors doesn't show output.
#include<iostream> using namespace std; class danielclass { public: string namefunction(string first_name, string last_name) { return fullname = first_name + " " + last_name; } private: string fullname; }; int main() { string namefirst; string namelast; danielclass nameobj; cout<<"enter first name: "; cin>>namefirst; cout<<"enter last name: "; cin>>namelast; cout<<"your full name is: "; cout<<nameobj.namefunction("" , ""); return 0; }
Comments
Post a Comment