-
Explanation to a note.
Hey there,I was reading a note and I came up across a couple of things I'd like to have explained to me.
My first question is, what is the purpose of the 2 besides the star on line 6 and the bracketed "int n"? Thanks in advance. This is not an assignment,just a note from the internet.
Code:
/* A void function with one argument */
#include <stdio.h>
/* a void function returns nothing */
void
stars2 (int n)
{
int i;
/* a loop displaying a star at
each iteration */
for (i=1; i<=n; ++i)
{
printf ("*");
}
/* change line after each series */
printf ("\n");
}
int
main (void)
{
int a;
a=10;
/* the argument may be a constant,
a variable or an expression */
stars2 (20);
stars2 (a);
stars2 (a+2);
return (0);
}
-
"stars2" is the function's name, while "int n" is it's argument. Functions in C