Napisałem kod:
#include
#include
using namespace std;
int main()
{
int a=10;
if(typeid(a) == typeid(int))
cout << "Zmienna a jest typu int" << endl << endl;
if(typeid(a) == typeid(99))
cout << "Zmienna a jest rowna 10" << endl << endl;
else
cout << "Zmienna a jest nie rowna 10" << endl << endl;
system("pause");
return 0;
}
Ale mam problem z instrukcją: if(typeid(a) == typeid(99)), zawsze wyświetla mi “Zmienna a jest rowna 10”.