Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include "point_list.h"
- #include <string.h>
- #include <stdio.h>
- int main(int argc, char** argv) {
- FILE* f;
- if (strcmp(argv[1], "loadtext") == 0) {
- f = fopen(argv[2], "w");
- } else {
- f = fopen(argv[2], "wb");
- }
- int amount = 2;
- fwrite(&amount, 1, sizeof(int), f);
- int data[2];
- data[0] = 1;
- data[1] = 2;
- for (int i = 0; i < amount; i++) {
- fwrite(&data[i], 1, sizeof(int), f);
- }
- fclose(f);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement