Hallo,
habe folgendes Problem und weiß nicht woran es liegt evtl kann mir ja jemand helfen.
Erstmal der Fehler.
Run-Time Check Failure #2 - Stack around the variable 'test' was corrupted.
Hier mal das Programm:
#include <stdio.h>
void main()
{
struct x
{
char a;
char b;
int c;
int d;
};
int wert;
struct x test;
struct x *ptr;
ptr = &test;
test.a = 'a';
test.b = 'b';
test.c = 1;
test.d = 3;
_asm
{
lea esp,[test]
add esp,8
mov eax,[esp]
mov wert,eax
}
printf("Wert: %i ",wert);
getchar();
}
Ein Kollege hat das gleich Programm und bei ihm kommt kein Fehler. Vielleicht kann mir ja jemand helfen. Habe schon gesucht aber finde kein vergleichbares Problem. (Das Programm ist ziemlich Sinnlos, einfach nur eine Übung)
MFG
habe folgendes Problem und weiß nicht woran es liegt evtl kann mir ja jemand helfen.
Erstmal der Fehler.
Run-Time Check Failure #2 - Stack around the variable 'test' was corrupted.
Hier mal das Programm:
#include <stdio.h>
void main()
{
struct x
{
char a;
char b;
int c;
int d;
};
int wert;
struct x test;
struct x *ptr;
ptr = &test;
test.a = 'a';
test.b = 'b';
test.c = 1;
test.d = 3;
_asm
{
lea esp,[test]
add esp,8
mov eax,[esp]
mov wert,eax
}
printf("Wert: %i ",wert);
getchar();
}
Ein Kollege hat das gleich Programm und bei ihm kommt kein Fehler. Vielleicht kann mir ja jemand helfen. Habe schon gesucht aber finde kein vergleichbares Problem. (Das Programm ist ziemlich Sinnlos, einfach nur eine Übung)
MFG