gpt4 book ai didi

c - SCNuFAST16 PRIuFAST16 警告 : unknown conversion type character 0x20 in format

转载 作者:太空宇宙 更新时间:2023-11-04 05:44:40 24 4
gpt4 key购买 nike

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 测试.c -o 测试

#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;
}

最佳答案

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

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

和:

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

关于c - SCNuFAST16 PRIuFAST16 警告 : unknown conversion type character 0x20 in format,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8858673/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com