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

  • Home
  • SEARCH
  • 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 6089645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:07:24+00:00 2026-05-23T12:07:24+00:00

I have a quick question. I am using C++ with the Allegro library. If

  • 0

I have a quick question. I am using C++ with the Allegro library.

If I make the following declaration BITMAP* blocks[600][14];, is it going to be wasted space if I only occasionally am using all 14 all of the second dimension or is that space only used when I specifically declare that part of the array?

For example:

BITMAP* blocks[600][14];
blocks[0][0] = load_bitmap("brick.bmp", NULL);
blocks[1][0] = load_bitmap("brick2.bmp", NULL);

Am I ‘wasting’ space by not using blocks[0][1], blocks[0][2] etc.?

Thanks,

Will.

  • 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-23T12:07:24+00:00Added an answer on May 23, 2026 at 12:07 pm

    In C++, arrays are contiguous so yes, you are ‘wasting’ the additional elements if you don’t use them.

    However, what you are wasting is only a single pointer (8 bytes on a 64-bit machine); not the actual bitmap data. So even if you use only one BITMAP* element in your 600×14 array you’re wasting ~67kB; which isn’t a massive amount in a modern desktop machine.

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

Sidebar

Related Questions

I have this quick question regarding cost estimation using Function Points. We are doing
I have a quick question about the two examples below. Currently I am using
I have a quick question about fetching results from a weakly typed cursor and
just a quick question: I am a CS undergrad and have only had experience
just a quick question, if I have a matrix has n rows and m
Quick question. What do you think, I have a few sites that use a
Have a quick question about what would be the best way to implement iterators
I have a quick question about how to serve data from a repository in
I have a quick question about TreeSet collections and hashCode methods. I have a
I have a quick question i hope you guys can answer, i've got a

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.