Monday, 26 August 2013

Return Variable as a Class Object - C++

Return Variable as a Class Object - C++

I have created a string class using a character array.
I actually to need place that array instead of class object. here's an
easy example.
I want to print a as an integer , not B as a class object which isn't
possible.
#include <iostream>
class T
{
int A ;
public : T ( )
{
A = 10 ;
}
} ;
void main ( )
{
T B ;
std :: cout << B ;
}
Is it possible?
Okay, but how?

No comments:

Post a Comment