-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram_dump.cpp
More file actions
22 lines (21 loc) · 897 Bytes
/
program_dump.cpp
File metadata and controls
22 lines (21 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define MIZU_IMPLEMENTATION
#include <mizu/serialize.hpp>
#include "fib_program.h"
#include "bubble_program.h"
#include <fstream>
int main() {
{
std::ofstream fib("fib.mizu.bin", std::ios::binary);
fp::raii::dynarray program = mizu::to_binary(fp::view<const mizu::opcode>{fib_program, sizeof(fib_program)/sizeof(fib_program[0])});
fib.write((char*)program.data(), program.size());
}{
std::ofstream bubble("bubble.mizu.bin", std::ios::binary);
fp::raii::dynarray program = mizu::to_binary(fp::view<const mizu::opcode>{bubble_program, sizeof(bubble_program)/sizeof(bubble_program[0])});
bubble.write((char*)program.data(), program.size());
}{
std::ofstream bubble_data("bubble.data.bin", std::ios::binary);
bubble_data.write((char*)sorted.data(), sorted.size() * sizeof(sorted[0]));
bubble_data.write((char*)numbers.data(), numbers.size() * sizeof(numbers[0]));
}
return 0;
}