mirror of
https://github.com/ada-dmitry/TMP_C712.git
synced 2026-09-24 09:10:16 +00:00
restart rep
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <error.h>
|
||||
|
||||
|
||||
int mtx(int *m, int s){
|
||||
srand(time(NULL));
|
||||
for(int i = 0; i < s; i++)
|
||||
*m++ = rand()%0xffff;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
int fd;
|
||||
int n,s;
|
||||
size_t ms;
|
||||
int *m;
|
||||
int *fa;
|
||||
|
||||
if (argc < 3){
|
||||
printf("Usage: a.out size filename\n");
|
||||
}
|
||||
s = n*n;
|
||||
ms = s*sizeof(int);
|
||||
|
||||
if((fd = open(argv[2], O_RDWR | O_CREAT | O_TRUNC, 0664)) == -1){
|
||||
perror("open: ");
|
||||
exit(errno);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user