Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs

Functions not working on


I am writing a C program using functions, and will not allow me to create them (Function definition is not allowed here), however they will work on other compilers.

Is there a certain format used for creating functions with

3 years ago
You are viewing a single comment. View All

I don't understand the syntax of defining functions inside functions.
You should define functions in the main scope of the file, i.e. outside of any other function.

int main() { int f1() { // no! } }
int main() { } int f1() { // yes }
3 years ago