Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How to have more than one main() in a project

0 votes
asked Sep 15, 2018 by Larry Gagnon (120 points)
I am learning C using OnlineGDB. I wish to test and write a number of very small C code snippets in one project. However, when I create a new file and then say name it Test2.c and it has another main() function in it as does the main.c file then I get an error saying I can only have one main() function.

I do not want to set up a whole series of projects for each code snippet.

Is there any way around this?

1 Answer

0 votes
answered Sep 16, 2018 by Anupama M (140 points)
in that one is calling function and other is called function.

void_copystring is called funtion.and main is calling function
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...