当前位置:网站首页>QT memory mapping
QT memory mapping
2022-06-25 13:47:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Recently, when looking at the code, I found Qt Memory mapping for , I only know MFC There is a memory mapping mechanism , You can save time when reading big data files , original Qt There are corresponding mechanisms in , Its usage is simpler , Here is a small example to demonstrate its usage
#include <QtCore/QCoreApplication>
#include <QFile>
#include <QDebug>
#include <iostream>
#include <stdio.h>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QFile file("1.txt");
file.open(QIODevice::ReadWrite);
qDebug() << QStringLiteral(" Memory size :") << file.size();
uchar *fpr = file.map(0, file.size());
int i = 0;
int x1 = 0, x2 = 0, x3 = 0;
char *pEnd1 = NULL;
char *pEnd2 = NULL;
char *pEnd3 = (char *)fpr;
for (int i = 0 ; i < 3 ; ++i)
{
x1 = strtod(pEnd3, &pEnd1);
x2 = strtod(pEnd1, &pEnd2);
x3 = strtod(pEnd2, &pEnd3);
std::cout << x1 << "," << x2 << "," << x3 << "\n";
}
file.close();
return a.exec();
}Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/151691.html Link to the original text :https://javaforall.cn
边栏推荐
- Golang keyboard input statement scanln scanf code example
- About data storage in memory
- [pit avoidance refers to "difficult"] halfcheckedkeys rendering problem in semi selected status of antd tree
- 用NumPy实现神经网络(Mysteries of Neural Networks Part III)
- Data acquisition system gateway acquisition plant efficiency
- Is it unsafe to make new debts
- À propos du stockage des données en mémoire
- Include what you use to save chaotic header files
- [pit avoidance refers to "difficult"] antd cascader implements new customized functions
- Which Chinese virtual human is better? Sullivan, IDC: Xiaobing Baidu Shangtang ranks in the first echelon
猜你喜欢

Shenzhen mintai'an intelligent second side_ The first offer of autumn recruitment

Prototype and prototype chain - constructor and instanceof
![[data visualization] antv L7 realizes map visualization, drilldownlayer drill asynchronously obtains data, and suspends the warning box](/img/81/f8280f16efa314d736c3a869c32ef0.jpg)
[data visualization] antv L7 realizes map visualization, drilldownlayer drill asynchronously obtains data, and suspends the warning box

k线图24种经典图解(影线篇)

测一测你的挣钱能力有多强?未来的你将从事什么职业?

Method for wrapping multiple promise instances into a new promise instance

Pointer, it has to say that the subject

触觉智能分享-RK3568在金融自助终端的应用

Replace element - counter use of content (2)

Win7显示屏幕亮度在哪里可以调节
随机推荐
Error1822 and error1824 are displayed in the database
Judge whether it is a mobile terminal
初始c语言的知识2.0
When the input tag type is number, the input of E, e, -, + is blocked
Insight into heap and stack stored in new string() /string() in JS
作为一名软件测试工程师你认为怎么样才能保证软件质量?
There is a problem with the date when MySQL imports and exports data to excel
OpenStack学习笔记(一)
leetcode:剑指 Offer II 091. 粉刷房子【二维dp】
Cesium learning notes
Related examples of data storage in memory
论文阅读:Graph Contrastive Learning with Augmentations
1024 hydrology
Websocket -- reverse proxy to solve cross domain problems
[open source Hongmeng system display] the rk3568 development board is equipped with openharmony 3.1 release
Cesium--- figure loading
关于扫雷的简易实现
Gorm-- search you don't know
C # switch between Chinese and English input methods
Class usage and inheritance in ES6