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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:24:18+00:00 2026-05-18T00:24:18+00:00

#include <stdio.h> #include <inttypes.h> int main(void) { int8_t int8; int16_t int16; int32_t int32; int64_t

  • 0
#include <stdio.h>
#include <inttypes.h>

int main(void)
{
    int8_t int8;
    int16_t int16;
    int32_t int32;
    int64_t int64;

    uint8_t uint8;
    uint16_t uint16;
    uint32_t uint32;
    uint64_t uint64;

    scanf("%"SCNd8"%"SCNd16"%"SCNd32"%"SCNd64"%"SCNu8"%"SCNu16"%"SCNu32"%"SCNu64, 
            &int8, &int16, &int32, &int64, &uint8, &uint16, &uint32, &uint64);

    printf("%"PRId8"\n%"PRId16"\n%"PRId32"\n%"PRId64"\n%"PRIu8"\n%"PRIu16"\n%"PRIu32"\n%"PRIu64"\n",
            int8, int16, int32, int64, uint8, uint16, uint32, uint64);

    return 0;
}

I can’t compile this code using latest gcc + MinGW + Netbeans + Windows. Netbeans says “unable to resolve identifier SCNd8 and SCNu8”. I can’t find any reference for SCNd8 and SCNu8 on gcc man page although http://linux.die.net/include/inttypes.h defines them. I don’t receive syntax error for using PRId8 or PRIu8.

MinGW inttypes.h (lacks SCNd8 and SCNu8 ) (sample code)

#define PRIXFAST64 "I64X"

#define PRIXMAX "I64X"
#define PRIXPTR "X"

/*
 *   fscanf macros for signed int types
 *   NOTE: if 32-bit int is used for int_fast8_t and int_fast16_t
 *   (see stdint.h, 7.18.1.3), FAST8 and FAST16 should have
 *   no length identifiers
 */

#define SCNd16 "hd"
#define SCNd32 "d"
#define SCNd64 "I64d"

#define SCNdLEAST16 "hd"
#define SCNdLEAST32 "d"
#define SCNdLEAST64 "I64d"

#define SCNdFAST16 "hd"    
  • 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-18T00:24:18+00:00Added an answer on May 18, 2026 at 12:24 am

    You could add the following after #include <inttypes.h>:

    #ifndef SCNd8
      #define SCNd8 "hhd"
    #endif
    #ifndef SCNu8
      #define SCNu8 "hhu"
    #endif
    

    Which should be appropriate for most platforms.

    Clarification:
    Where “most platforms” refers to platforms with a C99-compliant fscanf/scanf that can handle the hh prefix for char, not just the h prefix for short.

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

Sidebar

Related Questions

#include stdio.h #include conio.h #include <iostream> using namespace std; int main (void) { char
#include stdio.h #include conio.h void swap(int *x,int *y); void main() { int a=10,b=20; swap(a,b);
#include <stdio.h> #define MAX 5 int stk[MAX]; int top=-1; main() { char ch; void
My code is this (main.c): #include <inttypes.h> #include <stdio.h> int main(int argc, char **argv)
#include stdio.h #include conio.h int main(void) { if(printf(ABC)) { } else { printf(XYZ); }
#include stdio.h int main (void) { char xx[1000] = hello; sprintf (xx, xyzzy plugh
Consider this C code: #include stdio.h int main(void) { int count = 5; unsigned
#include<stdio.h> #include<conio.h> #include<iostream.h> void main() { int wh=1,i,j; int sale[5][3]; clrscr(); for(i=1;i<=5;i++) { for(j=1;j<=3;j++)
Consider the following code: #include <stdio.h> int main (void) { char str1[128], str2[128], str3[128];
#include stdio.h void Square(int num, int *myPointer); int main(int argc, const char *argv[]) {

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.