ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi, i am a beginner in programming with C. for this moment, i am using borland turbo C++ 3.0 as my compiler. i wonder about certain thing:
1. how to set a variable to hold value of current time ? for example, i want to set variable 'the_time' to hold the current time of a particular machine and it will keep that value even the time on that machine is running.
2. usually, we define a value for a variable or the user will be asked to key in the value. the value that defined by programmer will remain unchanged when we close it and rerun the program, while the value that inserted by user will be lost when the program is close.
my question is how how to make the value that had been inserted by user will remained for a variable so the user could used the the same value again when he reopen the program?
if there any solution, please let me know, and what is the header file should included for both of my question.
as for remembering the value of something you need to send it to permanant storage before you close the program ( ie write it to a file )
you would want either iostream.h for those types of functions. This is a small tutorial on file io http://www.codenewbie.com/forum/show...=&threadid=755
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.