Please help me with the error about multiple main function :')


  1. I created two files, file A and B.
  2. I made main function each on.
  3. I runned the second file (file B).

Current behavior:
4. Error named multiple main appeared.

Desired behavior
5. I want to make main file each, as I use each file for a class of the day.

Repl link:
class2-2.c - cookie-yoon-c - Replit

#include <stdio.h>

int main(void) {
  printf("Hello World");
  return 0;

Hi @mycookieyoon , welcome to the forums!
You can’t have 2 main functions. Instead, try renaming the function to something else then run the file again.
Hope this helps!


Due to how Replit compiles C++ programs, that isn’t really possible. I recommend making separate Repls instead.

1 Like