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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:09:02+00:00 2026-05-30T06:09:02+00:00

when compiling my program with GCC I get the following warning: format ‘%d’ expects

  • 0

when compiling my program with GCC I get the following warning:

format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int

Now just by playing around I realize %lo fixes the warning. However I don’t really understand what I am doing.

Is there a naming convention to get the short form of a type? For example, int is %d, why??

Thanks!

  • 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-30T06:09:03+00:00Added an answer on May 30, 2026 at 6:09 am

    However I don’t really understand what I am doing.

    What you’re doing is telling the printf function how to display the data that you provide following the format string. You’ll probably find that %lo doesn’t really print the results you expect — it prints the right data, but in octal (base 8) format.

    Is there a naming convention to get the short form of a type? For example, int is %d, why??

    The “short form” is called a format specifier. There’s no convention that lets you derive the appropriate printf format specifier. You just have to look them up in an appropriate reference.

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

Sidebar

Related Questions

Compiling with gcc 4.4.3 on Ubuntu 10.04.2 x86_64 I get the following warning: warning:
Recently I tried compiling program something like this with GCC: int f(int i){ if(i<0){
I'm having problems compiling the following program. I'm using gcc -framework Foundation inherit8.1m and
Hello I am compiling a program with make but I get the error of
When compiling C++ with the -fdump-tree-gimple option (GCC 4.6.1), I get code that has
Problem Why would compiling a program which has an int main(void) main function differ
I am compiling my program that will run on linux gcc 4.4.1 C99. I
While compiling a program in Java I got this big WARNING warning: [unchecked] unchecked
I'm compiling a program on my 64bit machine, but I'm not sure if it
I am getting the following error while compiling a sample program in Qt 4.5

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.