随笔分类 -  c++

指针的好处
摘要://struct parameter p; // p.fd=555; // p.hit=666 struct parameter*pptr=malloc(sizeof(struct parameter)); 阅读全文

posted @ 2017-06-13 23:15 freshman2014 阅读(505) 评论(0) 推荐(0)

c 结构体中存在指针,指针的不同赋值方法
摘要:#include<stdio.h>#include<stdlib.h>#include<string.h>struct parameter{ char *fd; int hit;};int main() { struct parameter*pptr = (struct parameter*)mal 阅读全文

posted @ 2017-06-13 22:59 freshman2014 阅读(2146) 评论(0) 推荐(0)

c++ std::find函数
摘要:template <class InputIterator, class T>InputIterator find (InputIterator first,InputIterator last,​ const T& val); first,last 分别指向一个序列中初始及末尾位置的输入迭代器。这 阅读全文

posted @ 2017-04-24 22:16 freshman2014 阅读(2104) 评论(0) 推荐(0)

istringstream 用法
摘要:istringstream 类用于执行C++风格的串流的输入操作 istringstream用空格作为字符串分隔符 #include <iostream>#include <sstream>#include <string>using namespace std;void test(){ { //i 阅读全文

posted @ 2017-04-24 22:11 freshman2014 阅读(4196) 评论(0) 推荐(0)

c++指向指针的指针与 c++指针作为函数参数传递问题
摘要:一直搞不明白,c++中指针到底是个啥东西,今天遇到到c++,指向指针的指针的问题,突然有点开窍了。 举个例子: int main(int argc, char** argv){ int a[5]={1,2,3,4,5}; int *p=a; int **pointer=&p; std::cout<< 阅读全文

posted @ 2016-03-17 18:01 freshman2014 阅读(4154) 评论(0) 推荐(0)

gdal库的编译安装
摘要:1. 从https://trac.osgeo.org/gdal/wiki/DownloadSource下载源码; 2. 解压源码到固定的目录,比如C:\code\gdal-2.0.1; 3.进入Visual Studio x64兼容工具命令提示(2010); 4.在兼容工具命令提示符中进入C:\co 阅读全文

posted @ 2016-03-11 11:46 freshman2014 阅读(1399) 评论(0) 推荐(0)

深入理解C++中public、protected及private用法
摘要:初学C++的朋友经常在类中看到public,protected,private以及它们在继承中表示的一些访问范围,很容易搞糊涂。今天本文就来十分分析一下C++中public、protected及private用法。相信对于大家深入掌握C++程序设计会有很大的帮助。 这里我们首先要明白下面几点。 1. 阅读全文

posted @ 2016-03-08 21:38 freshman2014 阅读(183) 评论(0) 推荐(0)

标准c++中的include "" 与<>的区别
摘要:#include<>直接从编译器自带的函数库中寻找文件#include""是先从自定义的文件中找 ,如果找不到在从函数库中寻找文件如果是自己写的头文件 建议使用#include“” 阅读全文

posted @ 2016-03-08 20:30 freshman2014 阅读(167) 评论(0) 推荐(0)

c++ vector用法
摘要:在c++中,vector是一个十分有用的容器,下面对这个容器做一下总结。 1 基本操作 (1)头文件#include<vector>. (2)创建vector对象,vector<int> vec; (3)尾部插入数字:vec.push_back(a); (4)使用下标访问元素,cout<<vec[0 阅读全文

posted @ 2016-03-08 20:28 freshman2014 阅读(1955) 评论(0) 推荐(0)

C++常成员函数 - const 关键字
摘要:转自:http://www.cnblogs.com/this-543273659/archive/2011/07/18/2109922.html 一、常成员函数详解 声明:<类型标志符>函数名(参数表)const; 说明: (1)const是函数类型的一部分,在实现部分也要带该关键字。 (2)con 阅读全文

posted @ 2015-12-29 17:43 freshman2014 阅读(304) 评论(0) 推荐(0)

c++ Const关键字
摘要:转自:http://blog.csdn.net/Eric_Jo/article/details/4138548C++中的const关键字的用法非常灵活,而使用const将大大改善程序的健壮性,本人根据各方面查到的资料进行总结如下,期望对朋友们有所帮助。Const是C++中常用的类型修饰符,常类型是指... 阅读全文

posted @ 2015-12-29 17:41 freshman2014 阅读(197) 评论(0) 推荐(0)

vs2010 boost库的编译与安装
摘要:编译过程: 1.首先去http://www.boost.org/users/download/下载boost的源码; 2.然后将源码放入一个文件加内,比如c:\lib\boost\boost_1_59_0\下 3.进入Visual Studio x64命令提示(2010)窗口,cd到c:\lib\b 阅读全文

posted @ 2015-12-15 19:34 freshman2014 阅读(1113) 评论(0) 推荐(0)

导航