Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- int _tmain(int argc, _TCHAR* argv[])
- {
- int i;
- long N;
- FILE *f;
- fopen_s(&f,"massiv1.bin","rb");
- if (f==NULL) {
- printf("Error in file!");
- return -1;
- }
- fseek(f,0,SEEK_END);
- N=ftell(f);
- fseek(f,0,SEEK_SET);
- int *mas = (int *) malloc(N);
- fread (mas, N, 1, f);
- fclose(f);
- printf("It's OK!\n");
- for (i=0;i<N/(sizeof(int));i++)
- printf("%4d",mas[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement