//estouro de variável
#include
int main()
{
short int sVar;
sVar = 32767;
cout << "Valor inicial = "
<< sVar << "\n";
// Soma 1.
sVar = sVar + 1;
cout << "Somando 1 = "
<< sVar << "\n";
// Soma mais 1.
sVar = sVar + 1;
cout << "Somando mais 1 = "
<< sVar << "\n";
system("pause");
}
Donwload link!
#include
int main()
{
short int sVar;
sVar = 32767;
cout << "Valor inicial = "
<< sVar << "\n";
// Soma 1.
sVar = sVar + 1;
cout << "Somando 1 = "
<< sVar << "\n";
// Soma mais 1.
sVar = sVar + 1;
cout << "Somando mais 1 = "
<< sVar << "\n";
system("pause");
}
Donwload link!
Comentários
Postar um comentário