Empowering CS learners, aspiring programmers, and startups with AI, Data Science & Programming insights — scaling skills from learning foundations to enterprise-grade solutions.
#include <stdio.h>
void meow(int n);
int main(void)
{
meow(3);
}
void meow(int n)
{
for (int i = 0; i < n; i++)
{
printf("meow\n");
}
}
[/dm_code_snippet]
The void before the meow function means that it doesn’t return a value, and likewise in main we can’t do anything with the result of meow, so we just call it.”
To me, it returns a value, which is “meow\n”. Once meow function called, it is generating an output, which to me returning a value. I know I am perhaps unable to differentiate between calling without value and calling with value. Help appreciated.