[Solved] error: ‘::main’ must return ‘int’ void main()

Because of the compiler, some compilers require that the int() function must have an int return value

Change void main() to int main(), and add return 0 to the end:

int main()
{
  ......//content
  return 0;
}

Compilation succeeded.

Read More: