c语言文件字节数组中,如何在winhex里面将一个文件转成C语言数组存储

满意答案

dcebd7a0de6265b6ccae5ead692f1eab.png

bltdj

2017.08.16

dcebd7a0de6265b6ccae5ead692f1eab.png

采纳率:46%    等级:8

已帮助:310人

你不如自己写一个bin2c的代码,然后编译运行。

给你一个做参考。#include 

#include 

#include 

#include "g_def.h"

#define OUT_BYTES_PER_LINE16

#define MAX_ARRAY_NAME_LEN20

typedef struct bin2c

{

char *in_name,

*out_name,

*array_name;

BOOL out_alloc;

char *out_buffer;

int out_buffer_size;

FILE *in_fp,

*out_fp;

int file_size;

}BIN2C_S, *BIN2C;

static inline void print_usage(void)

{

printf("Usage @gtool: bin2c.x in_file out_file [array_name]\n");

printf("convert bin file to c array\n");

printf("Arguments:\n");

printf("\tin_file:\tthe file name of input file\n");

printf("\tout_file:\toutput filename\n");

printf("\tarray_name:\toptional. if no array name set, will only convert data but not set array\n");

}

static inline BIN2C destroy_bin2c(BIN2C inst)

{

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值