TMyQueue//putdataintoqueue{QueueDatadatamemset(&data,0,sizeof(data))strcpy(data.data,"hello!")data.nId=0m_pMyQueue.TryPut(data)}//tryputdataintoqueue{QueueDatadatamemset(&data,0,sizeof(data))strcpy(data.data,"hello!")data.nId=0if(m_pMyQueue.TryPut(data)!=0){MessageBox("putqueueerror")}else{MessageBox("putqueuesuccess")}}//getdatafromqueue{QueueDatadatamemset(&data,0,sizeof(data))m_pMyQueue.Get(data)MessageBox(data.data)}//trygetdatafromqueue{QueueDatadatamemset(&data,0,sizeof(data))m_pMyQueue.TryGet(data)MessageBox(data.data)}-cohortofVCPackagingcategory///////////////////////////////////////////thisisaexampleforusingQueue///////-IMDN开发者社群-imdn.cn"> TMyQueue//putdataintoqueue{QueueDatadatamemset(&data,0,sizeof(data))strcpy(data.data,"hello!")data.nId=0m_pMyQueue.TryPut(data)}//tryputdataintoqueue{QueueDatadatamemset(&data,0,sizeof(data))strcpy(data.data,"hello!")data.nId=0if(m_pMyQueue.TryPut(data)!=0){MessageBox("putqueueerror")}else{MessageBox("putqueuesuccess")}}//getdatafromqueue{QueueDatadatamemset(&data,0,sizeof(data))m_pMyQueue.Get(data)MessageBox(data.data)}//trygetdatafromqueue{QueueDatadatamemset(&data,0,sizeof(data))m_pMyQueue.TryGet(data)MessageBox(data.data)}-cohortofVCPackagingcategory///////////////////////////////////////////thisisaexampleforusingQueue/////// - IMDN开发者社群-imdn.cn">
登录
首页 » 通信 » VC++ 封装了队列类 /// /// /// ///// //this a example for using Queue /////////////////...

VC++ 封装了队列类 /// /// /// ///// //this a example for using Queue /////////////////...

于 2023-07-24 发布 文件大小:33.71 kB
0 158
下载积分: 2 下载次数: 1

代码说明:

VC++ 封装了队列类 /// /// /// ///// //this a example for using Queue ///////////////////////////////////////// #include "Queue.h" //define queue data struct struct QueueData { char data[20] int nId } //define queue typedef TQueue TMyQueue //put data into queue { QueueData data memset(&data, 0, sizeof(data)) strcpy(data.data, "hello!") data.nId = 0 m_pMyQueue.TryPut(data) } //try put data into queue { QueueData data memset(&data, 0, sizeof(data)) strcpy(data.data, "hello!") data.nId = 0 if(m_pMyQueue.TryPut(data) != 0) { MessageBox("put queue error") } else { MessageBox("put queue success") } } //get data from queue { QueueData data memset(&data, 0, sizeof(data)) m_pMyQueue.Get(data) MessageBox(data.data) } //try get data from queue { QueueData data memset(&data, 0, sizeof(data)) m_pMyQueue.TryGet(data) MessageBox(data.data) }-cohort of VC Packaging category /////////////////////////////////////////// this is a example for using Queue ///////

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 聊天室 全方位的WEB开发学习应用交流共享服务 ASP技术 .NET技术...
    聊天室 全方位的WEB开发学习应用交流共享服务 ASP技术 .NET技术-chat rooms comprehensive Web application development learning-sharing services ASP technology.NET Technology
    2022-10-24 03:45:04下载
    积分:1
  • IOCP模型例子
    IOCP全称I/O Completion Port,中文译为I/O完成端口。IOCP 请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
    2022-03-03 21:40:38下载
    积分:1
  • 这是一个用LPC2132作的终端,有协议源代码和SED1335控制液晶源代码...
    这是一个用LPC2132作的终端,有通协议源代码和SED1335控制液晶源代码- This is the terminal which does with LPC2132, has passes the agreement source code and the SED1335 control liquid crystal source code
    2022-06-21 20:13:58下载
    积分:1
  • 从串口接收到数据后,实时显示波形或数据。初衷是用来显示msp430 sd16 发送的数据,波特率不能太大。...
    从串口接收到数据后,实时显示波形或数据。初衷是用来显示msp430 sd16 发送的数据,波特率不能太大。-Received from the serial data, real-time display waveforms or data. Mind is used to show the msp430 sd16 sent data, the baud rate should not too much.
    2023-08-24 15:25:04下载
    积分:1
  • Advanced Programming is a senior mail launch procedures to set smtp test also se...
    目录邮件发送高级编程是一个高级的邮件发动程序,能够设定smtp的验证,同时也能够发送附件,还能够设定各种编码以及数据加密。 -Advanced Programming is a senior mail launch procedures to set smtp test also sent to the annex, but also can set all kinds of coding and data encryption.
    2023-06-02 10:40:04下载
    积分:1
  • 这是一个串口调试器的源代码。
    这是一个串口调试器的源代码。-This is a serial debugger source code.
    2022-10-07 20:40:03下载
    积分:1
  • VC的多线程串口程序
    VC的多线程串口程序-VC multithread serial procedures
    2022-04-22 17:43:03下载
    积分:1
  • USB接口,CH375芯片读写U盘的部分程序段。 检测U盘是否正常工作。...
    USB接口,CH375芯片读写U盘的部分程序段。 检测U盘是否正常工作。-USB interface chip CH375 U disk read and write the part of the process. Detection U-normal work.
    2022-02-09 12:28:37下载
    积分:1
  • MAD
    MAD-FCL (version 1.7): The software is distributed in binary/source code formats under a GPL (GNU GENERAL PUBLIC LICENSE) license. Here is the official copyright and license. Distribution package is named to MAD-FCL (MAD FileCasting Library). Source distribution contains MAD-ALCLIB, MAD-SDPLIB and MAD-FLUTELIB libraries and MAD-FLUTE application. Binary distribution contains only MAD-FLUTE application. MAD-FCL is implemented using C-language. Latest binaries for Linux are compiled in Debian Linux with gcc version 4.0.4. MAD-FLUTELIB is based on RFC 3926 (FLUTE). -MAD-FCL (version 1.7): The software is distributed in binary/source code formats under a GPL (GNU GENERAL PUBLIC LICENSE) license. Here is the official copyright and license. Distribution package is named to MAD-FCL (MAD FileCasting Library). Source distribution contains MAD-ALCLIB, MAD-SDPLIB and MAD-FLUTELIB libraries and MAD-FLUTE application. Binary distribution contains only MAD-FLUTE application. MAD-FCL is imp
    2022-02-06 22:39:32下载
    积分:1
  • symbian Application
    Todolist记事本系统,实现了本地化增,删,改查,上传下载等功能-symbian Application
    2022-06-28 21:59:07下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载