Apps: Use the new %p in printf()
This commit is contained in:
parent
3ee1f34bc4
commit
40099feb80
@ -28,7 +28,7 @@ int main()
|
||||
{
|
||||
char* variable = malloc(200);
|
||||
*variable = 3;
|
||||
printf("Allocated variable at address %lx\n", (unsigned long int)variable);
|
||||
printf("Allocated variable at address %p\n", variable);
|
||||
free(variable);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ int main()
|
||||
sleep(1);
|
||||
void* allocated = malloc(CHUNK);
|
||||
do {
|
||||
printf("Allocating 4 MB of memory... %lx\n", (unsigned long)allocated);
|
||||
printf("Allocating 4 MB of memory... %p\n", allocated);
|
||||
sleep(1);
|
||||
} while ((allocated = malloc(CHUNK)));
|
||||
perror("malloc");
|
||||
|
Loading…
Reference in New Issue
Block a user