Gotchas: Difference between revisions
m
→printf()
Puppydrum64 (talk | contribs) m (→printf()) |
Puppydrum64 (talk | contribs) m (→printf()) |
||
Line 229:
The first function every C programmer learns (besides <code>main</code>), <code>printf</code> can be exploited in a similar fashion as <code>gets()</code>, but only if the programmer is irresponsible. <code>printf</code> can theoretically take any number of arguments; however there is no CPU that can actually support variadic functions in hardware (in the sense that the CPU knows how many arguments are passed into it without cheating, e.g. using a variable that holds the number of arguments as in <code>int argc, char** argv[]</code>).
The
<syntaxhighlight lang="C">int main()
|