Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

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

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.
0
taralpatel2000
Asked:
taralpatel2000
1 Solution
 
rcarlanCommented:
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?
0
 
gpaulishCommented:
rcarlan, good question i can't see any particular reason to need to do this...

-GP
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now