- 博客(16)
- 资源 (2)
- 收藏
- 关注
原创 如何从按行读文件&&以及每行中有多少个数据块,并输出每个数据块 (2)
针对上篇博客有些地方不足,在这里修正一下#include <iostream>#include <fstream>#include <string>using namespace std;int main(){ string FileName; //cin>>FileName; FileName = "1.txt"; ifstream infile(File
2016-05-17 16:29:10 449
原创 如何从按行读文件&&以及每行中有多少个数据块,并输出每个数据块
主要内容: 【1】如何读文件 【2】如何按行读文件 【3】每行数据块总数的判断 【4】每行数据块的输出不多说了,大家都亟不可待了吧,上代码#include <iostream>#include <fstream>#include <string>using namespace std;int main(){ string FileName; //cin>>Fil
2016-05-17 14:53:02 790
原创 string怎么转换为char*
1.方法string对象的data()方法string对象的c_str()方法string对象的copy方法#include <iostream>using namespace std;int main(){ // 1. string对象的dat()方法 string str = "lijiajia"; char*p= (char*)str.data();
2016-05-17 10:09:55 3391
原创 win32控制台应用程序实现定时
1.实例一#include<iostream>#include<windows.h>#include <Mmsystem.h>#pragma comment(lib, "winmm.lib")using namespace std;void CALLBACK TimeProc( UINT uID, UINT uMsg, DWORD dwUser, DWORD
2016-05-16 11:21:11 588
原创 定时器SetTimer如何使用在win32控制台应用程序中(2)
代码说明#include "windows.h"#include "stdio.h"void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT nTimerid, DWORD dwTime){ printf("%s", "abc");}void main(){ SetTimer(0, 0, 1000, &TimerProc);
2016-05-16 11:07:37 672
原创 定时器SetTimer如何用在win32控制台用用程序中
SetTimer如何用在win32控制台应用程序中可以使用在main函数中开一个子线程的方法,在子线程中用while(1){}的方式处理定时器的操作#include <Windows.h>#include <stdio.h>#include <conio.h>VOID CALLBACK TimerProc( HWND hwnd, // handle of window fo
2016-05-16 10:55:23 4458
原创 如何加载网络套接字版本
加载网络套接字的版本WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested = MAKEWORD(2,2);//这里是选择2.2版本 err = WSAStartup(wVersionRequested,&wsaData); if(err != 0) return;
2016-05-15 19:58:55 427
原创 【数据结构】表之链表
1.单链表的几大功能【1】头插法创建 【2】尾插法创建 【3】显示 【4】销毁2.见程序#include <iostream>#include <malloc.h>using namespace std;typedef int ElemType;typedef struct Lnode{ ElemType data; struct Lnode *next;}LinkL
2016-05-15 16:35:31 260
原创 【数据结构】表之顺序表
1.表分类顺序结构链式结构2.本文讲解顺序表创建顺序表```#include <iostream>#include <malloc.h>using namespace std;#define MAXSIZE 50typedef int ElemType;typedef struct{ ElemType data[MAXSIZE]; int length;}Sq
2016-05-15 12:31:57 494
原创 指针常量和指向常量的指针
1.指针常量指针常量,有几点需要注意。 (1)顾名思义,其实是一个指针, (2)并且这个指针是一个常量,不能修改了, (3)但是它指向的地址内的数据是可以修改的, (4)生声明的时候必须初始化。 例如char ch1[5] = "liji";char* const pStr1 = ch1;//【1】声明的时候,必须赋初值;【2】指针常量,指向的地址值不可修改,但可以修改指向的地址内的数据
2016-05-12 00:05:29 353
原创 动态链接库(4)回调函数在动态链接库之外的情况如何处理
1.建立动态链接库DLL3DLL3.cpp的代码如下#include <iostream>using namespace std;void Pro1(int a, int(*Fun1)(int b)){ if (a > 100) { Fun1(a); } else { cout << "不调用其它函数" << endl
2016-05-10 10:10:48 2231
原创 怎么样连接两个char*型的字符串变量
直接见代码#include <iostream>using namespace std;int main(){ char* str1 = "Hello"; char*str2 = "World"; //方式一 char str3[20]; strcpy(str3, str1); strcat(str3, str2); cout << st
2016-05-09 20:36:16 27388 3
原创 从txt文件中读数据画车位(2)
从txt文件中读取数据在图片上画梯形功能说明 (1)c语言读文件的运用 (2)将从文本文件中读取的数据进行转换 (3)opencv库的使用:画梯形,画矩形代码展示#include <iostream>#include <opencv2/opencv.hpp>using namespace cv;using namespace std;char s[40][20] = { 0 };
2016-05-06 11:13:23 856
原创 在图片上画车位存入txt文件中(1)
在图片上画车位并将车位的信息存入txt文件功能说明 (1)利用opencv库,在一幅图片上进行画梯形操作 (2)将画出的梯形的信息存入文本文件中代码展示#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;#define OK 0#define ERR -1P
2016-05-06 11:07:02 542
原创 判断两幅Mat型的图片是否是相同的,然后进行相应的处理
1.怎么判断Mat型图片是否相同?只需要判断每个像素点是否是相等的即可2.代码说明#include <iostream>#include <opencv2/opencv.hpp>using namespace std;using namespace cv;int main(){ //mat1 与 mat2 进行比较 //mat2 与 mat3 进行比较 Mat
2016-05-02 10:29:31 4198
原创 从txt文件中逐行读取字符串,并且用读取到的字符串在Mat型的图片上画矩形
1.程序主要功能从txt文件中逐行读取字符串把字符串转换成整型的数值把整形的数值赋值给一个点的横坐标和纵坐标在一张图片上画矩形opencv的使用文件的读取过程2.代码说明#include <iostream>#include <opencv2/core/core.hpp>#include <opencv2/highgui/highgui.hpp>using namespace s
2016-05-02 01:39:37 1027
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人