abcd_hallo
Mitglied
Hallo.
Ich stehe gerade voll auf dem Schlauch. Kann mir jemand helfen?
Ausgabe:
Ich benutze MS Visual Studio 6
thx
Ich stehe gerade voll auf dem Schlauch. Kann mir jemand helfen?
Code:
#include <stdio.h>
#include <malloc.h>
void myfunk(int* test);
int main ()
{
int *test;
test = (int*) malloc (sizeof(int));
myfunk(test);
for (int i=0; i<10; i++)
printf("%d\n", test[i]);
return 0;
}
void myfunk(int* test)
{
for (int i=0; i<10; i++)
{
test = (int*) realloc (test, i+1);
test[i] = i;
}
}
Ausgabe:
Code:
-842150656
-842150451
-33698355
65021
4
5
6
7
8
9
Ich benutze MS Visual Studio 6
thx