#include <string>
using namespace std;
struct C
{
operator const char *(){return “”;}
operator string(){return “”;}
};
int main()
{
string str;
const ……继续阅读 »
9年前 (2016-06-02) 1400浏览
0个赞
这是头文件test.h里的代码:
template <class T>
class test
{
private:
T a,b;
public:
test();
test(T a,T b);
void output();
};
这是源文件test.cpp里的代码:
#include “test.h”
#include &l……继续阅读 »
9年前 (2016-06-02) 3609浏览
0个赞
dll中函数原型:
int DllReturn(char* cReturn)
{
for(int n=0; n<iATRLen; n++) //
{
str.Format(“%02x”,reply.message.negativeReply.Data.bBody[n]); //reply.message.negativeRe……继续阅读 »
9年前 (2016-06-02) 1341浏览
0个赞
char g_cData[1024] = {0};
boost::asio::io_service ioservice;
boost::asio::ip::tcp::endpoint ep(boost::asio::ip::address::from_string("192.168.100.1"),1234);
boost::asio::ip::tcp::……继续阅读 »
9年前 (2016-06-02) 4082浏览
1个赞
要接收像这样的不定长数据帧,该怎么实现,使用的是第三方Qextserialport类。
帧结构:
帧头1 (1byte)+ 帧头2(1byte) + 数据长度(1byte) + 数据(n byte) + 校验(1byte) + 帧尾1(1byte) + 帧尾2(1byte)
学习了下Qextserialport在Windows的例子,使用事件触发的方式,串口……继续阅读 »
9年前 (2016-06-02) 5703浏览
1个赞
#include <iostream>
#include <stdio.h>
using namespace std;
int d_ = 1;
int s_ =2;
class A{
};
int main()
{
A *d = new A();
A *s = new A();
cout<<&d<<……继续阅读 »
9年前 (2016-06-02) 1569浏览
0个赞
如题,未delete的动态数组不是可以任意范围使用吗?怎么好像NumInLay 这个只能在声明定义的函数内使用?
另外多问一句,怎么定义一个动态数组能让一个类的不同函数调用该数组的值?
void BPNet::init()
{
//隐藏层层数
int hidenLayNum=2;
int* NumInLay = new int[hidenLayN……继续阅读 »
9年前 (2016-06-02) 1137浏览
0个赞
a.h
#pragma once
class CClassa
{
CClassa(void);
virtual ~CClassa(void);
int add(int a,int b);
}
a.cpp
#include "StdAfx.h"
#include "Classa.h"
CClassa::CClassa(void)
{
}
CClassa::~……继续阅读 »
9年前 (2016-06-02) 1096浏览
0个赞
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system(“pause”) or input loop */
int main(int arg……继续阅读 »
9年前 (2016-06-02) 1683浏览
0个赞