Skip to content

Instantly share code, notes, and snippets.

@surinoel
Created July 24, 2019 04:45
Show Gist options
  • Save surinoel/15860e4a42f91c9b8ddf0453f71561b0 to your computer and use it in GitHub Desktop.
Save surinoel/15860e4a42f91c9b8ddf0453f71561b0 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define OPSZ 4 // 정수형 사이즈
char buf[1024];
int main(int argc, char **argv)
{
for(int i=0; i<5; i++) {
scanf("%d", (int*)&buf[OPSZ*i]);
}
for(int i=0; i<5; i++) {
printf("%d ", *(int*)&buf[OPSZ*i]);
}
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment