File: alignment.c

package info (click to toggle)
njamd 0.9.3pre2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,704 kB
  • ctags: 1,056
  • sloc: ansic: 9,367; sh: 7,921; makefile: 121; perl: 52
file content (12 lines) | stat: -rwxr-xr-x 213 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char *buf = malloc(20);
    fprintf(stderr, "addr at: %p (%ld)\n", buf, buf);
    *(double *)(buf) = 3.3;
    *((char **)(buf)) = buf;    
    return 0;
}