放置0和a是什么意思。 %

问题描述 投票:1回答:1
之前

我遇到此代码

scanf("0.%[0-9]...\n", &x);

为什么我们使用0。%之前?

c scanf
1个回答
2
投票

您在scanf中放入的常规字符(不是转换的一部分,应在提供输入时按顺序输入,例如:

scanf("<-%c", c); // Need to suply <- and then a character.

否则将无法接受输入。

© www.soinside.com 2019 - 2024. All rights reserved.