Expression preceding parentheses?

The error is referring to this line: Here you’re (apparently) trying to call delay as a function. However, delay is declared as: It’s just a number, not a function, hence you can’t call it.

Reading a string with scanf

An array “decays” into a pointer to its first element, so scanf(“%s”, string) is equivalent to scanf(“%s”, &string[0]). On the other hand, scanf(“%s”, &string) passes a pointer-to-char[256], but it points to the same place. Then scanf, when processing the tail of its argument list, will try to pull out a char *. That’s the Right Thing when you’ve passed in string or &string[0], but when … Read more

where does stdio.o live in linux machine?

I’d suggest that you run gcc -v your_file.c. That will let you see exactly what commands your linker is using. You probably don’t have an stdio.o file to link against. Instead this is included in the C runtime library and the exact file will depend on your system configuration.

How do you pass a function as a parameter in C?

Declaration A prototype for a function which takes a function parameter looks like the following: This states that the parameter f will be a pointer to a function which has a void return type and which takes a single int parameter. The following function (print) is an example of a function which could be passed to func as a parameter because it is … Read more