File: print_bin.c

package info (click to toggle)
libslow5lib 0.7.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 25,092 kB
  • sloc: ansic: 11,825; python: 1,179; sh: 547; makefile: 91; cpp: 40
file content (20 lines) | stat: -rw-r--r-- 307 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <stdlib.h>
//#include <unistd.h>

int main(void) {

    float *x = malloc(sizeof *x);
    *x = 32.0f;

    int *y = malloc(sizeof *y);
    *y = (int) *x;

    fwrite(y, sizeof *y, 1, stdout); 
    //write(STDOUT_FILENO, y, sizeof *y);

    free(x);
    free(y);

    return 0;
}