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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:39:40+00:00 2026-05-29T10:39:40+00:00

This is how I am declaring my array of integers: int registers[16]; And this

  • 0

This is how I am declaring my array of integers:

int registers[16];

And this is how I’m filling my array:

 void fill_registers()
{
registers[0] = 0 ; registers[1] = 0x11111111; registers[2] = 0x22222222;
registers[3] = 0x33333333; registers[4] = 0x44444444; registers[5] = 0x55555555;
registers[6] = 0x66666666; registers[7] = 0x77777777; registers[8] = 0x88888888;
registers[9] = 0x99999999; registers[10] = 0xAAAAAAAA; registers[11] = 0xBBBBBBBB;
registers[12] = 0xCCCCCCCC; registers[13] = 0xDDDDDDDD; registers[14] = 0xEEEEEEEE;
registers[15] = 0xFFFFFFFF;
}

And this is how I’m printing them back out at the user in hex format…

void print_all_registers()
{int i = 0 ;
    for(i= 0 ;i < 16 ; i++)
    {
        printf("REG %d : %x \t %d \n ", i, registers[i],registers[i]);
    }
}

The only problem with this is that it doesn’t work correctly, I just keep getting values.

I basically must be able to add + subtract the register values eg. +2 to 11111111
And the other problem is when printing it it must also print in 8 digits for example
00000001 rather than just 1. I’ve looked in many tutorials but can’t seem to find any that help.

I just don’t understand why it doesn’t work. Here is an example of how it doesn’t work. If I do:

registers[1] = registers[1] + 2 ;

this would result in a value of 2 when it should be something like 11111113.

  • 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-29T10:39:40+00:00Added an answer on May 29, 2026 at 10:39 am

    You’re not showing enough code. But to 0-pad a value, do something like this:

    printf("REG %d: %08x\n", i, registers[i]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When declaring an array like this: int array[][] = { {1,2,3}, {4,5,6}}; I get
When declaring an array in C like this: int array[10]; What is the initial
This is the code that I have to dynamically declaring an array inside a
If I am using an int as the array size when declaring a new
What's the real difference between declaring an array like this: var myArray = new
Are declaring custom .NET event such as this , more common in a winform
Would this be the correct way of declaring that an XML element Cluster contains
I am getting this error for re-declaring saveorder() however, I don't think I am?!?
I'm declaring an instance of a class like so: Matrix m; This appears to
I'm having trouble declaring a const field in an abstract class. Why is this?

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.