hey, iam working on c++ and i need help .
will u plz tel me how do i insert time to my system....
i tried with time.h and bios.h but it doesent work ..
also how do i execute a batch file of .exe from c++.

Recommended Answers

All 7 Replies

To change the time on your computer is operating system dependent. If you have a modern computer then you will have to use a modern compiler so that it can access os api functions. On MS-Windows you will use SetSystemTimer()

As for the batch files, call system() function.

commented: good +0

To change the time on your computer is operating system dependent. If you have a modern computer then you will have to use a modern compiler so that it can access os api functions. On MS-Windows you will use SetSystemTimer()

As for the batch files, call system() function.

well thanx for reply .
but iam not familiar with api programming. or windows programming.
will u plz show me a prog code....

Read the link I gave you -- it will tell you everything you need to know. Just include windows.h in your console program.

meybe it will be Sleep();

maybe what will be Sleep()? Do you know what you are talking about?

Ancient Dragon Sleep(1) eg: sleep can suspend the thread for second

Yes I know that, but how does that relate to changing the time on the computer?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.