/
xverizex
/
byte-calc
Обзор
Документация
Войти
/
xverizex
/
byte-calc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
main.cpp
33 строки
642 B
Dmitry
init
11 июл 2026, 17:38
11 июл 2026, 17:38
7a2ad86
Код
Авторство
О чём код?
#include <iostream> #include <filesystem> #include <fstream> #include <vector> #include "calc.h" int readFile (std::string filepath, std::uintmax_t sz, std::string& buf) { std::fstream file (filepath, std::ios::in); if (file.is_open()) { buf.resize (sz); file.read (buf.data(), sz); file.close (); } return -1; } int main (int argc, char **argv) { std::filesystem::path example = "test.lang"; std::uintmax_t filesz = std::filesystem::file_size (std::filesystem::current_path() / example); std::string buf; int ret = readFile (example, filesz, buf); parse_equation (buf); }