栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

c++内存地址模拟蓝牙信号

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

c++内存地址模拟蓝牙信号

//
// Created by lk on 18-10-14.
//
#include 
#include 
#include 
#include 
#define random(a,b) (rand()%(b-a)+a)

using namespace std;

int main()
{	
	fstream fs("C:\Users\lenovo\Desktop\bluetooth.txt", ios::out);
	srand((int)time(0));  // 产生随机种子  把0换成NULL也行
	int	last = 0;
	int current;
	int* address = new int();
	for (int k=0;k<50;++k)
	{
		for (int j = 0; j < random(20, 30); ++j)
		{
			current = random(80, 100);
			if (current != last)
			{
				address = new int();
			}
			fs << address << " ";
			last = current;
		}
		fs << endl;
	}
	
	fs.close();
	system("pause");
	return 0;
}//5 5 9 7 9 6 5 5 7 7   产生5到10之间的数, 不包括5 和 10

采用c++内存地址模拟50个用户手机搜集到的蓝牙mac地址,取堆上的地址,真的极为巧妙!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1018788.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号