Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new ___arrayNull___[1] = { 0 };
- #define _(ARRAY)NULL ___arrayNull___
- static stock arrayToFile(filename[], _array[], size = sizeof _array)
- {
- size *= 4;
- new File:tmpFile = fopen(filename, io_write);
- for(new i = 0; i < size; i++)
- fputchar(tmpFile, _array{i}, false);
- fclose(tmpFile);
- }
- static stock fileToArray(filename[], _array[], size = sizeof _array)
- {
- size *= 4;
- new File:tmpFile = fopen(filename, io_read);
- memcpy(_array, _(ARRAY)NULL, 0, size); // Заполняем массив нулями
- for(new i = 0; i < size; i++)
- _array{i} = fgetchar(tmpFile, _array{i}, false);
- fclose(tmpFile);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement