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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:28:29+00:00 2026-06-13T20:28:29+00:00

I have some code with following parts: typedef unsigned long long int ulli_t; typedef

  • 0

I have some code with following parts:

typedef unsigned long long int ulli_t;
typedef unsigned int obj_t;
// --- SOME UNIMPORTANT PART OF CODE
objects = (obj_t*)malloc(hw*sizeof(obj_t));
objNums = (ulli_t*)calloc(hw, sizeof(ulli_t));
printf("%#x, %#x\n", objects, objNums);
// --- SOME UNIMPORTANT CODE
/// NEXT PART IS for-CYCLED
objNums[k] ++;
if (k>=Nobj) {
   objects[k] = obj;
   Nobj++;
   printf(" %lu - %#x - %#x\n", k, objects+k, objNums+k);
};

And I’ve got an output of this part of code:

0xaafdf9d8, 0xaad693b0
 0 - 0 - 0xaafdf9d8
 1 - 0 - 0xaafdf9dc
 2 - 0 - 0xaafdf9e0
 3 - 0 - 0xaafdf9e4
 4 - 0 - 0xaafdf9e8
 5 - 0 - 0xaafdf9ec
 6 - 0 - 0xaafdf9f0
 7 - 0 - 0xaafdf9f4
 8 - 0 - 0xaafdf9f8
 9 - 0 - 0xaafdf9fc
 10 - 0 - 0xaafdfa00
 11 - 0 - 0xaafdfa04

So, here is the question – If ‘objects’ variable is non-zero then why does ‘objects+k’ is zero?
When I make :

printf(" %lu - %#x - %#x\n", k, objects[k], objNums[k]);

I get lines like:

value of k - 0 - hex value of objNums[k]

Why is that?
I already got my brain broken thinking about that thing.

  • 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-13T20:28:30+00:00Added an answer on June 13, 2026 at 8:28 pm

    You are using %lu to print your long long. You should use %llu.

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

Sidebar

Related Questions

I have the following code: typedef unsigned char some_type[6]; int main() { some_type some_var1;
I have the following code: Some functions: A::A(int i_a) {cout<<int Ctor\n;} //conversion constructor void
We have following code: try { // some code throwing MyException } catch (MyException
I have some JavaScript code that works in IE containing the following: myElement.innerText =
i am new in JSP,i have some problem with the following code : <%@
I have the following perl script: $myVariable = some value; //... some code ...
Suppose I have the following: using(var ctx = DataContextFactory.Create(0)) { ... Some code ...
I'm using some not optimal code written by me... :-| I have following code:
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
i have the following code which switches some fullscreen-background-images (fadeOut, fadeIn). setInterval(function() { var

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.