File: print_bin.c

package info (click to toggle)
libslow5lib 1.3.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,280 kB
  • sloc: ansic: 13,123; python: 1,353; sh: 600; makefile: 98; 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;
}