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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:49:56+00:00 2026-05-29T07:49:56+00:00

I write a simple code:- void * aa = malloc(10 * sizeof(char)); printf(%X\n, aa);

  • 0

I write a simple code:-

 void * aa = malloc(10 * sizeof(char));
 printf("%X\n", aa);
 free(aa);

It always prints ???????8,
What I want to ask is:
Does malloc always return a 4*n address?
And why here the last number of the address always is 8? why not 4 or C?
my environment:
ubuntu 10.04 (32 bit)
gcc version 4.4.3

  • 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-29T07:49:57+00:00Added an answer on May 29, 2026 at 7:49 am

    The reasons are generally rooted in alignment issues; the constraint is there to fulfill processor requirements, assist cache optimization strategies or other reasons.

    As part of the core purpose of satisfying system (OS, language specification, processor) alignment requirements which would otherwise result in either faults (with varying impacts depending on the system) or inefficient behavior (having to do extra memory reads to get the same data as it straddles a memory block boundary) at runtime, a minimum alignment requirement will apply.

    However you may empirically find that they are aligned to an even higher degree than that strictly required by the preceding constraints. For example, a specific allocator implementation might increase it for reasons such as:

    • adding memory overrun barriers and/or other integrity checking/verification mechanisms
    • allow pointers to be stored more efficiently (e.g. if you know the bottom 4 bits are zero, you can potentially pack them in some manner when you persist them
    • simplifying or increasing the efficiency of address computations
    • reducing fragmentation and/or other reasons which may seem to make not offer a benefit for an individual alllocation but satisfy some goal across a larger set of allocations
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to write a simple task which will update and commit source code
I want to write a simple web proxy, for exercise. Here's the code I
i write a simple webservice code in asp.net when i build the service and
I write a simple piece of code that creates a div and assign it
I am trying to write simple Visual Studio Add-In for code generation. In my
I am trying to write a simple tool using Shoes. This will indent code
Question simple and quick: I have started to use Netbeans to write some code
I'm trying to think of clever, clear, and simple ways to write code that
I'm trying to write a simple stack code and I get this code from
Is it worth to write unit-tests for such the simple code: public class TableController

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.