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; } 

you need pass strings function work:

cout<<nameobj.namefunction(namefirst ,namelast); 

here example


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -