将C ++程序与计算机内存链接 [英] linking c++ program with computer memory

查看:63
本文介绍了将C ++程序与计算机内存链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我用C ++创建程序时,它是临时的;如何将其链接到计算机内存,以便即使在再次运行该程序后关闭程序,也不会丢失以前存储的数据?

When i create a program in c++ its temporary; how can i link it to computer memory such that even after closing the program when i run it again the data i had previously stored is not lost?

推荐答案

将所有数据存储在硬盘上.无法确保可以将数据临时存储在RAM中,因为关闭应用程序后,其他应用程序很容易将其覆盖.最简单的解决方案是某种配置文件,在关闭应用程序并重新启动时,您可以在其中存储所有必需的数据.
You need to store all of the data on your hard drive. There is no way to ensure that you can temporarily store data in the RAM since it can easily be overwritten by other applications after you close your application. The simplest solution would be some kind of config file where you store all your required data when closing the application and when restarting, you read back the data.


此链接将帮助您编写和读取文件:
http://www.cplusplus.com/reference/iostream/fstream/ [
This link will help you to write and read a file:
http://www.cplusplus.com/reference/iostream/fstream/[^]


这篇关于将C ++程序与计算机内存链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆