return char from function in C++ by R4R Team


program:

#include < iostream>

using namespace std;
class Myclass
{
public:
char func()
{
return 'A';
}
};
int main()
{
char s;
Myclass obj;
s=obj.func();
cout<<"Char is: "<< s;
return 0;
}


output-

Char is: A




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!