Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int *x, y = 0;
- x = (int *) malloc(sizeof(int)*4);
- if(x == NULL){
- printf("Nao foi possivel alocar memoria.");
- exit(0);
- }
- for(y = 0; y < 4; y++){
- x[y] = y+3;
- }
- FILE *bin;
- bin = fopen("arquivo.bin", "rb");
- if(bin == NULL){
- printf("Nao foi possivel abrir o arquivo.");
- exit(0);
- }
- fread(x, 16, 1, bin);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement