0

I'm a web developer, trying to learn more about C programming. My C training is purely academic, so i thought i'd start with reading some source code on Github. My project of choice was https://github.com/cesanta/mongoose - Mongoose Web Server, as i used it on several occasions.

Browsing through the source (mongoose.c), i noticed there is no 'main' function. I can't figure out what is the first function that is called.

So, my questions are:
1. Isn't there always a main function in C programs?
2. If not, how do i figure out what is the first function that is called?

Gergo Erdosi
  • 40,904
  • 21
  • 118
  • 94

1 Answers1

0

There is always an entry point to any program, but software libraries generally do not have entry points. In terms of whether the entry point is always called main, you can look at this question.

mongoose.c is the source code for a library, so there is no main function.

The main functions are all in the clients of that library, which are available under examples.

Community
  • 1
  • 1
merlin2011
  • 71,677
  • 44
  • 195
  • 329