1.1
Copied!
#include <iostream>
#include <typeinfo>
using namespace std;
class myclass {
// . . .
};
int main() {
int i, j;
float f;
myclass ob;
cout << "i oʻzgaruvchi tipi: " << typeid(i).name() << endl;
cout << "f oʻzgaruvchi tipi: " << typeid(f).name() << endl;
cout << "ob oʻzgaruvchi tipi: " << typeid(ob).name() << endl << endl;
if (typeid(i) == typeid(j))
cout << " i va j tiplar bir xil.\n";
if (typeid(i) != typeid(f))
cout << " i va f tiplar bir xil emas.\n";
system("PAUSE");
return 0;
}
Run on cpp.sh
Copied!