cout <<"(Unesite broj bez tacke na kraju)#";
cin >> glavniMeni;
glavniMeni promenljiva je tipa int. Pokusao sam sa funkcijom isdigit() (iz ctype.h) ali ona mi je uvek davala vrednost 0.
void ProveraUnosaBroja(int i)
{
if (!isdigit(i))Imam program za koji mi treba provera unosa. Na primer ako korisnika pitam koju opciju zeli
cout <<"(Unesite broj bez tacke na kraju)#";
cin >> glavniMeni;
glavniMeni promenljiva je tipa int. Pokusao sam sa funkcijom isdigit() (iz ctype.h) ali ona mi je uvek davala vrednost 0.
void ProveraUnosaBroja(int i)
{
if (!isdigit(i))
{
cout << "Nije digitalni broj";
i = 0;
}
}
{
cout << "Nije digitalni broj";
i = 0;
}
}
Ken Thompson has an automobile which he helped design. Unlike most automobiles, it has neither speedometer, nor gas gauge, nor any of the other numerous idiot lights which plague the modern driver. Rather, if the driver makes a mistake, a giant “?” lights up in the center of the dashboard. “The experienced driver,” says Thompson, “will usually know what’s wrong.”