Salve ragazzi ho questo problema...
Quando eseguo questo programma:
{
int a, i;
cout << "Inserisci il numero che dovrebbe essere presente nell'array:\n";
cin >> a;
int mioarray[3];
mioarray[0] = 32;
mioarray[1] = 10;
mioarray[2] = 7;
mioarray[3] = 8;
for ( i = 0; i <= 3; i++ ) {
if (mioarray[i] == a) {
cout << "Il valore " << a << " e' presente nell'array, precisamente nell'indice: mioarray[" << i << "]";
break;
} else {
cout << "Spiacente il numero che hai inserito non e' presente nell'array";
break;
}
}
return 0;
}
Mi da un errore del tipo:
STACK AROUND THE VARIABLE 'MIOARRAY' WAS CORRUPTED!
Come posso risolvere? Grazie anticipatamente!