0

well i use bootime function to get and store time in my bios
but i want to enter time in my system . what should i use for time and what to do for date
well i am using time.h header files for that

also i need to know about pragma startup and endup directive

is it compulsary to write main fun in c and c++,can we only write 1 main fun.
plz give ur ans. with reasons

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by mike_2000_17
0

is it compulsary to write main fun in c and c++,can we only write 1 main fun.

Well the main function is the entry point for the executable. Just a special function that the compiler knows should be the sort-of first implicit call to start the program. So if you are not making an executable, like making a DLL or library or something like that, then a main function is not necessary and probably will do more harm then good. If you have more than one main function, how is the compiler supposed to know which one is the "program function", which one to start at the start of the executable? So an executable requires one and only one main function, anywhere in the code (one exception: Win32 programs start with WinMain(), but still the same rule apply to winmain as for main). I'm not entirely sure, but I think that if you try to execute an executable with no main() function in the console, it will say "this program cannot be executed in console mode." and vice versa for winmain.

well i use bootime function to get and store time in my bios but i want to enter time in my system . what should i use for time and what to do for date well i am using time.h header files for that

I'm not sure I understand the goal, but you probably want to take a look at Boost::Date_Time library. This is cross-platform and has all features that are supported by all systems (not sure you can reset the local_time, but maybe).

Edited by mike_2000_17: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.