c - 如何将带有机器代码的文件存储到数组中
问题描述
我将如何存储任何类型的带有文本 ex 的文件。sasm,mach(用于机器代码)等。我不想像这样写并将它直接放入数组https://ttm.sh/hPS.png 我希望能够从文件中获取文本像这样的文字
0x1000
0x30C3
0x11FC
并将其存储到数组 program[] 中,并将新行作为数组中的新点
解决方案
怎么样:
unsigned program[] = {
#include "program.mach"
};
与 program.mach 看起来像:
0x1000,
0x30C3,
0x11FC
推荐阅读
- r - 在 R 中使用不同的语法拆分列
- c++ - 如何用 boost::future 重新抛出 std::exception_ptr 存储的原始异常?
- angular - 如何在 Angular 4 反应形式 ng-select 中使用管道
- python - 使用 keras 进行多重营销归因
- ruby-on-rails - 在 Rails 中使用 HAML 设置表单样式
- google-cloud-platform - Cloud Foundry cli i/o 超时
- spring-integration - 如何在java中实现集成路由器
- javascript - React + immutable.js:将 Map 合并到 Map 列表中以更新状态
- c++ - 用于验证 Visual Studio 一致性开关对生成代码的影响的工具
- r - 谷歌表格上的 R 脚本