I am reading the book "Programming in C" and found in Chapter 10 an example like this:
#include <stdio.h>
void test (int??*int_pointer)
{
?????*int_pointer = 100;
}
int main (void)
{
?????void test (int??*int_pointer);
?????int??i = 50, *p = &i;
?????printf ("Before the call to test i = %i
", i);
?????test (p);
?????printf ("After the call to test i = %i
", i);
?????return 0;
}
I understand the example, but I don't understand the line void test (int *int_pointer);
inside of main
. Why do I define the signature of test
again? Is that idiomatic C?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…