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

  • Home
  • SEARCH
  • 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 8733891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:44:19+00:00 2026-06-13T09:44:19+00:00

What is the format specifier for an _int8 data type? I am using %hd

  • 0

What is the format specifier for an _int8 data type?

I am using “%hd” but it is giving me an error about stack corruption. Thanks 🙂

This is a snippet of the code:

signed _int8 answer;

printf("----Technology Quiz----\n\n");
printf("The IPad came out in which year?\n");
printf("Year: ");
scanf("%hd", &answer);
printf("\n\n");
printf("The answer you provided was: %hd\n\n", answer);
  • 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-13T09:44:21+00:00Added an answer on June 13, 2026 at 9:44 am

    To use the “explicit width” typedefs like int8_t and uint_fast16_t portably in C99 in the format strings of printf and scanf, you need to #include <inttypes.h> and then use the string macros PRIi8 and PRIuFAST16, like so:

    #include <stdint.h>   // for the typedefs (redundant, actually)
    #include <inttypes.h> // for the macros
    
    int8_t a = 1;
    uint_fast16_t b = 2;
    
    printf("A = %" PRIi8 ", B = %" PRIuFAST16 "\n", a, b);
    

    See the manual for a full list, and cross-reference it with the typedefs in <stdint.h>.

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

Sidebar

Related Questions

I know that using the %s format specifier and std::string like this leads to
While I'm using %g as format specifier in printf() , sometimes it rounds up
Is there a way to use Int32.ToString(<some string format specifier>) with using more than
Which format specifier should I be using to print the address of a variable?
Possible Duplicate: Correct format specifier to print pointer (address)? When printing a pointer using
I tried using Formatter.format, but that seems to leave the mantissa on numbers with
I'm using the Visual Studio 11 beta and I'm curious about a compilation error
Is there any benefit to include the length specifier in a format string for
I want to convert one xml format to another specified format by using xslt.
I'm using svn:externals and I've specified a specific revision using the SVN1.5+ format ,

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.