#include <iostream>
using namespace std;
class Test{
int i; // data member
public :
Test(){
cout<<"\nYou Entered Test Class.";
i = 10;
showValue(); // Member function
}
void showValue(){
cout<<"\n i = "<<i;
}
}obj;
main(){}
Q. Will it be an error ? If yes why ? If no why ?
using namespace std;
class Test{
int i; // data member
public :
Test(){
cout<<"\nYou Entered Test Class.";
i = 10;
showValue(); // Member function
}
void showValue(){
cout<<"\n i = "<<i;
}
}obj;
main(){}
Q. Will it be an error ? If yes why ? If no why ?
0 comments:
Post a Comment