xcode (const char *restrict, ...) 是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27285262/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does (const char *restrict, ...) mean?
提问by josh_balmer
When I type printf
, Xcode give me an autocomplete-hint like printf(const char *restrict, ...)
.
当我输入 时printf
,Xcode 会给我一个自动完成提示,如printf(const char *restrict, ...)
.
I want to know what does "const char *restrict mean?
And where can I find more information about these parameters which Xcode throws for every function?
我想知道“const char *restrict 是什么意思?
我在哪里可以找到有关 Xcode 为每个函数抛出的这些参数的更多信息?
采纳答案by dasblinkenlight
There is no magic behind this: Xcode looks at the headers that you included, checks function prototypes, and figures out signatures, and provides you hints as you type based on the prefixes that it sees.
这背后并没有什么神奇之处:Xcode 会查看您包含的标头,检查函数原型并找出签名,并在您键入时根据它看到的前缀提供提示。
Look at the header documentation for the headers that you include to find out what functions they have, and what are the parameters. For example, printf
is part of stdio.h
header, which is documented here. The signature of printf
is as follows:
查看您包含的标头的标头文档,了解它们具有哪些功能以及参数是什么。例如,printf
是stdio.h
标头的一部分,记录在此处。的签名printf
如下:
int printf(const char *restrict, ...);
That is why Xcode suggests printf(const char *restrict, ...)
for the hint as you type.
这就是 Xcodeprintf(const char *restrict, ...)
在您键入时建议提示的原因。