随笔 - 1759  文章 - 0  评论 - 109  阅读 - 430万
03 2019 档案
cmake的使用方法
摘要:cmake的主要特点: 1.跨平台,并可生成 native 编译配置文件,在 Linux/Unix 平台,生成 makefile,在 苹果平台,可以生成 xcode,在 Windows 平台,可以生成 MSVC(Microsoft Visual C++ ) 的工程文件。 来源:https://www 阅读全文
posted @ 2019-03-27 13:22 一杯明月 阅读(363) 评论(0) 推荐(0) 编辑
scons的使用
摘要:以下测试是在linux下. 1.安装. sudoaptinstallscons2.:scons --version 会出现以下内容: 3.在任意位置建立文件夹helloscons. 4.在helloscons文件夹下建立两个文件:源文件helloscons.c和配置文件sc 阅读全文
posted @ 2019-03-26 19:55 一杯明月 阅读(756) 评论(0) 推荐(0) 编辑
c++写文件
摘要:#include<iostream> #include<fstream>//fstream标识文件流 using namespace std; int main() { ofstream outfile;//ofstream: out file stream outfile.open("myfile 阅读全文
posted @ 2019-03-25 14:40 一杯明月 阅读(181) 评论(0) 推荐(0) 编辑
define用于条件编译
摘要:格式: #ifndef _test.h_ //这里放不想被重复包含的代码 #define _test.h_ #endif define用于条件编译的意思是不想让头文件重复编译,头文件重复编译会造成的结果: 1.文件变大. 2.引起重复编译错误. 阅读全文
posted @ 2019-03-24 18:16 一杯明月 阅读(375) 评论(0) 推荐(0) 编辑
ubantu中让g++支持c++11的办法
摘要:g++ main.cpp -std=c++11 -o a 其中: main.cpp是要编译的源文件 a是编译后的文件名 注意-std=c++11不要写成-std=c11 阅读全文
posted @ 2019-03-21 14:33 一杯明月 阅读(647) 评论(0) 推荐(0) 编辑
构造函数=default表示什么?
摘要:myClass()=default;//表示默认存在构造函数 阅读全文
posted @ 2019-03-21 14:03 一杯明月 阅读(2630) 评论(0) 推荐(0) 编辑
c++中的函数对象《未完成》
摘要:头文件: #pragma once #include<iostream> #include<vector> using namespace std; class Student { public: Student(double hei):height(hei){} double getheight( 阅读全文
posted @ 2019-03-19 10:01 一杯明月 阅读(153) 评论(0) 推荐(0) 编辑
c++中的函数对象
摘要:头文件wuyong.h: #pragma once #include<iostream> using namespace std; template<typename T> struct ismulti { T a; ismulti(const T& b):a(b){} bool operator( 阅读全文
posted @ 2019-03-18 19:48 一杯明月 阅读(168) 评论(0) 推荐(0) 编辑
c++ STL库deque和vector的例子
摘要:头文件wuyong.h: #pragma once #include<iostream> #include<vector> #include<deque> #include<algorithm> #include<string> using namespace std; class Player { 阅读全文
posted @ 2019-03-17 21:42 一杯明月 阅读(386) 评论(0) 推荐(0) 编辑
容器,算法和迭代器实现的基本思路
摘要:直接上代码,一调试,一切就明白: 直接在源文件中实现,源文件的名字随便取: #include<iostream> using namespace std; int mycount(int* start ,int* end, int val)//算法,负责统计某个容器中某个元素出现的个数 { int 阅读全文
posted @ 2019-03-17 09:45 一杯明月 阅读(260) 评论(0) 推荐(0) 编辑
C++的转换函数
摘要:听侯捷老师的讲课笔记: 所谓转换函数指的是类型之间的转换,比如把自定义的类类型转换成内建类型(比如double),后者向相反的方向转。 直接上代码: 头文件conversion_function.h: #pragma once #include<iostream> using namespace s 阅读全文
posted @ 2019-03-16 15:39 一杯明月 阅读(2014) 评论(0) 推荐(0) 编辑
使用roboware创建工作空间
摘要:1.打开终端,启动roboware软件: $roboware-studio 2.在欢迎使用的页面点新建工作区,工作区的名字建议写为:catkin_ws,路径放在home文件夹或者任意你想放的文件夹中.新建工作区也可以这样: 点击:文件-->新建工作空间(注意:软件界面此时要最大化,才能看见顶部的菜单 阅读全文
posted @ 2019-03-13 22:54 一杯明月 阅读(1827) 评论(0) 推荐(0) 编辑
ROS创建工作空间
摘要:1.mkdir catkin_ws && cd catkin_ws && mkdir src 2.catkin_make (#这一句是完成编译初始化,注意括号内的内容不可复制,初始化工作空间之后,catkin_ws文件夹中会多出build和devel这两个文件夹,注意:catkin_make编译 阅读全文
posted @ 2019-03-12 21:58 一杯明月 阅读(1990) 评论(0) 推荐(0) 编辑
linux升级g++
摘要:参考:https://blog.csdn.net/qq_33233768/article/details/73274467 阅读全文
posted @ 2019-03-12 12:31 一杯明月 阅读(970) 评论(0) 推荐(0) 编辑
ROS配置C++14环境
摘要:ROS配置C++11环境打开Terminal,sudo vim /opt/ros/<yourversion>/share/catkin/cmake/toplevel.cmake 比如: sudo vim /opt/ros/kinetic/share/catkin/cmake/toplevel.cma 阅读全文
posted @ 2019-03-12 10:59 一杯明月 阅读(691) 评论(0) 推荐(0) 编辑
ubantu查看环境变量
摘要:echo $ROS_PACKAGE_PATH 阅读全文
posted @ 2019-03-11 18:37 一杯明月 阅读(152) 评论(0) 推荐(0) 编辑
C++指向函数的指针
摘要:直接上代码: #include<iostream> #include<string> #include<vector> using namespace std; typedef int(*PF)(int *, int); typedef bool (*cmpFcn)(const string&, c 阅读全文
posted @ 2019-03-11 16:15 一杯明月 阅读(193) 评论(0) 推荐(0) 编辑
ubantu删除文件(夹)
摘要:格式:rm -rf 目录名字 -r 就是向下递归,不管有多少级目录,一并删除 -f 就是直接强行删除,不作任何提示的意思 名称 概述 描述 选项 阅读全文
posted @ 2019-03-11 09:40 一杯明月 阅读(473) 评论(0) 推荐(0) 编辑
ROS环境搭建
摘要:参考:https://www.ncnynl.com/archives/201801/2273.html 阅读全文
posted @ 2019-03-09 19:22 一杯明月 阅读(871) 评论(0) 推荐(0) 编辑
vmware workstation pro 安装ubantu虚拟机
摘要:这个也可以参考:https://zhuanlan.zhihu.com/p/150263093 下面的来源是:https://www.jianshu.com/p/faf8bbbdd0f2 必要条件: PC VMware Workstation https://my.vmware.com/cn/web/ 阅读全文
posted @ 2019-03-09 13:43 一杯明月 阅读(1727) 评论(0) 推荐(0) 编辑
Win7下删除Ubuntu启动项
摘要:参考:https://www.cnblogs.com/ywl925/archive/2013/05/26/3100010.html 阅读全文
posted @ 2019-03-09 12:54 一杯明月 阅读(182) 评论(0) 推荐(0) 编辑
ubantu16.04
摘要:http://mirror.pnl.gov/releases/xenial/ ubuntu16.04下载地址: 中科大源 http://mirrors.ustc.edu.cn/ubuntu-releases/16.04/ 阿里云开源镜像站 http://mirrors.aliyun.com/ubun 阅读全文
posted @ 2019-03-08 14:27 一杯明月 阅读(378) 评论(0) 推荐(0) 编辑
github之克隆
摘要:git clone --depth=10 git_仓库_url 意思是获取最近10条提交记录的代码,默认是master分支, 如果想要指定分支,可以结合 -b --single--branch 使用! depth用于指定克隆深度,为1即表示只克隆最近一次commit. 这种方法克隆的项目只包含最近的 阅读全文
posted @ 2019-03-07 22:42 一杯明月 阅读(617) 评论(0) 推荐(0) 编辑
ubuntu卸载软件
摘要:1.打开一个终端,输入dpkg --list ,按下Enter键,终端输出以下内容,显示的是你电脑上安装的所有软件。 2.在终端中找到你需要卸载的软件的名称,列表是按照首字母排序的。 3.在终端上输入命令sudo apt-get --purge remove 包名(--purge是可选项,写上这个属 阅读全文
posted @ 2019-03-07 22:42 一杯明月 阅读(558) 评论(0) 推荐(0) 编辑
linux下安装boost
摘要:参考:http://www.cnblogs.com/weizhixiang/p/5804778.html 阅读全文
posted @ 2019-03-07 14:28 一杯明月 阅读(282) 评论(0) 推荐(0) 编辑
cmd(或者说DOS窗口)输出内容到文件
摘要:格式是:command >> filefullpath 格式是:DOS命令>>文件名全路径 举例说明: dir *.* >> D:\abc.txt dir *.* > D:\abc.txt >> 代表追加。 > 代表写覆盖。 阅读全文
posted @ 2019-03-07 11:56 一杯明月 阅读(3747) 评论(0) 推荐(0) 编辑
C++中的枚举
摘要:#include<iostream> #include<iomanip> using namespace std; int main() { enum color_set { red, yellow, blue, white, black }; //声明枚举类型color color_set col 阅读全文
posted @ 2019-03-04 21:52 一杯明月 阅读(745) 评论(0) 推荐(0) 编辑
关于C++类的成员函数是否要加关键字“const”
摘要:原则:类的成员函数在小括号后大括号前加上 const ,代表不准备改变对象的数据。不加的话代表有可能会改变对象的数据。 1.当常量对象,就是加上const修饰的类的成员去调用常量成员函数时,这表示:对象的初始化数据一定不能改变,常量成员函数说:放心,我不会改变你的初始化数据的,这一切都很好。 2.当 阅读全文
posted @ 2019-03-04 14:55 一杯明月 阅读(586) 评论(0) 推荐(0) 编辑
C++的decltype
摘要:参考:https://www.cnblogs.com/cauchy007/p/4966485.html 阅读全文
posted @ 2019-03-04 10:04 一杯明月 阅读(1039) 评论(0) 推荐(0) 编辑
C++的异常捕获
摘要:听课笔记: #define _CRT_SECURE_NO_WARNINGS #include<iostream> using namespace std; void fun() { throw 1;//抛出整型异常值 } void fun02() { throw "hello!";//抛出const 阅读全文
posted @ 2019-03-03 15:56 一杯明月 阅读(618) 评论(0) 推荐(0) 编辑
String类的写法
摘要:听侯捷老师讲课的笔记: string.h头文件: #pragma once class String { public: String(const char* cstr); String(const String& str); String& operator =(const String& str 阅读全文
posted @ 2019-03-03 10:42 一杯明月 阅读(229) 评论(0) 推荐(0) 编辑
手写vector
摘要:听课笔记: vecotr.h头文件: #pragma once /*写一个容器vector*/ template<typename T> class Myarray { public: Myarray(); Myarray(int capacity); Myarray(const Myarray<T 阅读全文
posted @ 2019-03-02 21:37 一杯明月 阅读(440) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示