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
4

Functions not working on repl.it

ZachT78
ZachT78

I am writing a C program using functions, and Repl.it 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 repl.it?

https://repl.it/@ZachT78/PCW027

3 years ago

Voters

Comments

TopNew
5
mwilki7
mwilki7

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
Load more