如何使用c ++和cmd打开二进制文件? [英] How do you open a file in binary using c++ and using cmd?

查看:342
本文介绍了如何使用c ++和cmd打开二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,请帮助...我正在开发一个程序,该程序应读取二进制文件,读取文件中的详细信息并将其显示在屏幕上.我正在使用Ubuntu

I''m a newbie please help...i am working on a program that should read a binary file, read the details in the file and display them on the screen. I''m using Ubuntu

推荐答案

我很困惑. Ubuntu还是cmd?

无论如何,您可以使用fopen()打开文件,使用fread()读取文件,使用fclose()关闭文件.这些是可移植的(在Linux和Windows上均可使用).

以下是一些链接(流"是文件):

http://www.gnu.org/software/libc/manual/html_node/Opening- Streams.html [ ^ ]

http://www.gnu.org/software/libc/manual/html_node/Block-Input_002fOutput.html#Block-Input_002fOutput [ ^ ]

http://www.gnu.org/software/libc/manual/html_node/Closing-Streams.html#Closing-Streams [ ^ ]

欢迎使用C ++,

Pablo.
I''m puzzled. Ubuntu or cmd?

Anyway, you may open a file using fopen(), read using fread(), close using fclose(). These are portable (will work both on Linux and on Windows).

Here are some links (''streams'' are files):

http://www.gnu.org/software/libc/manual/html_node/Opening-Streams.html[^]

http://www.gnu.org/software/libc/manual/html_node/Block-Input_002fOutput.html#Block-Input_002fOutput[^]

http://www.gnu.org/software/libc/manual/html_node/Closing-Streams.html#Closing-Streams[^]

Welcome to C++,

Pablo.


这是一个可能对您有帮助的教程.

http://www.cppforschool.com/tutorial/Files1.html [
here is a tutorial it may help you.

http://www.cppforschool.com/tutorial/Files1.html[^]

if you have any problem while programming then you should ask here. we feel happy to help you.

These kind of tutorials are readily available on many sites.
Thanks...


这篇关于如何使用c ++和cmd打开二进制文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆