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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:00:01+00:00 2026-06-02T02:00:01+00:00

I am using Code::Blocks with GCC 4.4.1 and I seem to be unable to

  • 0

I am using Code::Blocks with GCC 4.4.1 and I seem to be unable to print 64-bit signed integers from my C-code.

This code:

long long longint;

longint = 0x1BCDEFABCDEFCDEF; /* 2003520930423229935 */
printf("Sizeof: %d-bit\n", sizeof(longint) * 8);     /* Correct */
printf("%llx\n", longint);                           /* Incorrect */
printf("%x%x\n", *(((int*)(&longint))+1), longint);  /* Correct */
printf("%lld\n", longint);                           /* Incorrect */ 

Produces output:

Sizeof: 64-bit
cdefcdef
1bcdefabcdefcdef
-839922193

64-bit arithmetic seems to work correctly:

longint -= 0x1000000000000000;
printf("%x%x\n", *(((int*)(&longint))+1), longint);

Gives:

bcdefabcdefcdef

Am I missing something?

  • 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-02T02:00:04+00:00Added an answer on June 2, 2026 at 2:00 am

    See if %I64d helps you. %lld is fine for long long int but things get really different sometimes on Windows IDEs

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

Sidebar

Related Questions

I am using code::blocks, with, I believe gcc. Given the example code (this is
I'm using the Code::Blocks IDE with the GNU GCC compiler. struct test { char
I seem to be using this block of code alot in Python. if Y
I have been using the gcc compiler with code::blocks ide, and have noticed there
I'm compiling this code with GNU GCC Compiler in Code Blocks but for some
Im using Ubuntu 10.10, Code::Blocks with GCC 4.2. I have written a code like
I'm using code::blocks on a linux system with the gcc compiler, and I want
This code is C/C++ and runs without warnings or debug messages. I'm using Code::blocks
I am using Code Block with GNU GCC Compiler. And I am trying this
I'm using Code::Blocks to compile a shared library on Ubuntu. When I make 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.