must. get. 64-bit machine.
This commit is contained in:
parent
70d09f33a1
commit
a414f515d1
29
gowrikumar/src/06b-ia64segfault.c
Normal file
29
gowrikumar/src/06b-ia64segfault.c
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* :author: Dan Buch (daniel.buch@gmail.com)
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int* p;
|
||||
|
||||
size_t size_of_int = sizeof(int);
|
||||
printf("sizeof(int) = %d\n", size_of_int);
|
||||
|
||||
p = (int*)malloc(sizeof(int));
|
||||
|
||||
size_t size_of_p = sizeof(p);
|
||||
printf("sizeof(p) = %d\n", size_of_p);
|
||||
|
||||
*p = 10;
|
||||
|
||||
size_t size_of_ptr_p = sizeof(*p);
|
||||
printf("sizeof(*p) = %d\n", size_of_ptr_p);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* vim:filetype=c:fileencoding=utf-8
|
||||
*/
|
Loading…
Reference in New Issue
Block a user