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 7651987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:38:58+00:00 2026-05-31T11:38:58+00:00

how can I put the file.bmp to array using standard lib c++ or c

  • 0

how can I put the file.bmp to array using standard lib c++ or c whithout windows.h ect

edit
I want to get bmp colors to array change the array and put to bmp using standard lib

  • 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-05-31T11:39:00+00:00Added an answer on May 31, 2026 at 11:39 am

    Use a binary stream:

    #include <fstream>
    
    char buffer[100];
    ifstream myFile ("myImage.bmp", ios::in | ios::binary);
    myFile.read (buffer, 100);
    
    myFile.close();
    

    However, parsing it will be a bit trickier if you insist on doing it that way. I suggest you look into a generic C++ image library, such as the boost GIL (doesn’t support bmp) or this open source bmp library.

    If you are unable to use any third party or OS-specific libraries, you will have to parse the data yourself. The C++ standard libraries don’t include anything to do that for you. You’ll have to start by familiarising yourself with the BMP structure. Wikipedia’s article has a good description of it.

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

Sidebar

Related Questions

How can I put file content in XML? I am using Linq to SQL
Is there a command I can put into a Windows XP .bat file to
We can put our file say one.txt in txt folder available in tomcat->webapp folder.
I'm wondering how can I put a header into my PDF file, cause I've
A user can put a file in the server if the file name matches
Usually I can put an xml-file (of non-android format, the same would be if
What is SQLite? Can I put audio file in it and use it with
How can I put up a File Open dialog from some VBA running in
With VIM or Emacs I can put comments in the file that will be
How can I put that file in userdata.img so that the emulator can read

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.