Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7801287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:54:01+00:00 2026-06-02T00:54:01+00:00

How can i read content of a file which is not a simple text

  • 0

How can i read content of a file which is not a simple text file in c/c++? For example, I want to read image file such as .jpg/.png/.bmp and see the value at certain index,to check what colour it is? or if I have a .exe/.rar/.zip and want to know what value is stored at different indices?
I am aware of c style reading file, which is

FILE *fp;

fp = fopen("example.txt","r"); /* open for reading */

char c;

c = getc(fp) ;

I want to know if i replace “example.txt” with “image.png” or so, will it works? will i get correct data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:54:02+00:00Added an answer on June 2, 2026 at 12:54 am

    You would need to open the file in binary mode. This allows you to read the bytes in a “raw” mode where they are unchanged from what was in the file.

    However, determining the color of a particular pixel, etc. requires that you fully understand the meaning of the bytes in the file and how they are arranged for the file being read. This second requirement is much more difficult. You’ll need to do some research on the format of that file type in order to do that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can JQuery/JavaScript read/get the file content on the client side, where the file is
I have to copy and do some simple processing on file. I can not
Problem I have a file which contains such text (nothing else) 2010-10-05 I would
Can a firefox XPCOM component read and write page content across multiple pages? Scenario:
I can read settings like this, for example: final String mytest = System.getString(this.getContentResolver(), System.AIRPLANE_MODE_ON);
I can read XLS file with this code : string path =@c:\r\1.xlsx; OleDbConnection MyConnection
Consider the following simple C program that read a file into a buffer and
I'm trying to create a simple class to read a csv file and store
I want to associate a text-based custom file type with my app on iOS.
I can read the current delivery count using javax.jms.Message.getIntProperty(JMSXDeliveryCount). I'm trying to read the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.