Hello everybody
I wrote this code but the result did not appear because of errors
the result appear only in online editor and visual studio new versions
but in my visual studio 2010 many errors appear
maybe it is a small error
and I saw a red color under the = in the code maybe it is the error
thank you very much
#include <iostream>
#include <string>
#include<stdio.h>
#include<conio.h>
using namespace std;
class teacher1 {
private:
std::string str1 = "master";
std::string str2 = "homework";
public:
teacher1();
~teacher1();
void msg();
};
teacher1::teacher1(){cout<<"This is the information about mr.samer najjar"<<endl;}
teacher1::~teacher1(){cout<<" end of the information"<<endl;}
void teacher1::msg(){
std::cout << "samer najjar holds a " <<str1 <<" degree ."<< std::endl;
std::cout << "samer najjer corrects the students' " <<str2 <<"."<<""<<endl<< std::endl;
}
class teacher2 {
private:
std::string str3 = "docturate";
std::string str4 = "homework";
public:
teacher2();
~teacher2();
void msg1();
};
teacher2 ::teacher2(){cout<<"this is the information about mr.rateb hennawi"<<endl;}
teacher2 ::~teacher2(){cout<<" end of the information"<<endl;}
void teacher2::msg1(){
std::cout << " rateb hennawi holds a " <<str3 <<" degree ."<< std::endl;
std::cout << " rateb hennawi corrects the students' " <<str4 <<endl<<""<<std::endl;
}
int main() {
teacher1 temp;
temp. msg();
teacher2 nim;
nim .msg1();
return 0;
}