SCNuFAST16 PRIuFAST16警告:格式为未知转换类型字符0x20

时间:2012-01-13 23:32:33

标签: c

test.c: In function ‘main’:
test.c:10: warning: unknown conversion type character 0x20 in format
test.c:10: warning: unknown conversion type character 0x20 in format
test.c:12: warning: conversion lackstype at end of format
test.c:12: warning: unknown conversion type character 0xa in format
test.c:12: warning: conversion lacks type at end of format
test.c:12: warning: unknown conversion type character 0xa in format

gcc test.c -o test

#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

int main(int argc,char *argv[]){

    uint_fast16_t n_curve,n_pt;

    printf("Please enter new value \n");
    scanf( "% %" SCNuFAST16 SCNuFAST16, &n_curve, &n_pt);

    printf("You enter % % \n" PRIuFAST16 PRIuFAST16, n_curve, n_pt);
    return 0;   
}

1 个答案:

答案 0 :(得分:6)

这不是您使用这些格式说明符的方式。你想要:

scanf("%"SCNuFAST16" %"SCNuFAST16, &n_curve, &n_pt);

printf("You enter %"PRIuFAST16" %"PRIuFAST16"\n", n_curve, n_pt);