How to call use defined functions before the main function is running in c

Posted on 2005-03-29
Medium Priority
Last Modified: 2010-04-17
I want to call user defined function in C before the Main() function is running.
i.e. I want to run my own function before the main() fuction is running at start of my program.
Question by:taralpatel2000
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

rcarlan earned 200 total points
ID: 13651689
Easy to do in C++ (constructor for global variable).
In C, depending on the compiler you use, you can specify a different entry point to the standard "main".

What exactly is it that you want to achieve through your pre-main function?

Expert Comment

ID: 13652473
rcarlan, good question i can't see any particular reason to need to do this...


Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Six Sigma Control Plans
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question