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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:50:58+00:00 2026-06-15T02:50:58+00:00

How do I printf long long int and also unsigned long long int in

  • 0

How do I printf long long int and also unsigned long long int in C99 using GCC?

I have searched the other posts which suggest to use %lld but it gives these warnings:

warning#1: unknown conversion type character ‘l’ in format [-Wformat]|
warning#2: too many arguments for format [-Wformat-extra-args]|

For the following attempt:

#include <stdio.h>

int main()
{
   long long int x = 0;
   unsigned long long int y = 0;
   printf("%lld\n", x);
   printf("%llu\n", y);
}
  • 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-15T02:50:59+00:00Added an answer on June 15, 2026 at 2:50 am

    If you are on windows and using mingw, gcc uses the win32 runtime, where printf needs %I64d for a 64 bit integer. (and %I64u for an unsinged 64 bit integer)

    For most other platforms you’d use %lld for printing a long long. (and %llu if it’s unsigned). This is standarized in C99.

    gcc doesn’t come with a full C runtime, it defers to the platform it’s running on – so the general case is that you need to consult the documentation for your particular platform – independent of gcc.

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

Sidebar

Related Questions

#include <iostream> #include <fstream> #include <cstring> using namespace std; typedef unsigned long int WORD;
#include <limits.h> #include <stdio.h> int main() { long ival = 0; printf(ival: %li, min:
I have 145064642 chars long HTML String which I am trying to print. When
$ printf 'int main(){}' | gcc -static -x c - -o hello $ scp
(This is gcc 3.3.1 (long story -- blame NIST) on Cygwin.) I have compiled
int main() { int a; void *p; p = &a; printf(%ld\n,(long)p); p = p+1;
I have a problem while using the printf function to print values of type
bool CReadWrite::write(unsigned long long offset, void* pvsrc, unsigned long long nbytes) { int m_WriteResult;
When I use PRINT statements to debug and monitor long running queries in SQL
I have a very long table in my webpage. When I print it, it

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.