What does (const char *restrict, ...) mean?

josh_balmer picture josh_balmer · Dec 4, 2014 · Viewed 11.2k times · Source

When I type printf, Xcode give me an autocomplete-hint like 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?

Answer

Sergey Kalinichenko picture Sergey Kalinichenko · Dec 4, 2014

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.

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:

int printf(const char *restrict, ...);

That is why Xcode suggests printf(const char *restrict, ...) for the hint as you type.