cpp/c
不做毛毛虫
这个作者很懒,什么都没留下…
展开
-
c++私有成员函数
#include class Integer{ public: Integer() { std::cout<<"Constructor Integer"<<std::endl; } void seta(int bv) { a=bv;//类中数据成员的形参与类的数据成员重名 } void set(int v1,int v2,int v3) { seta(v1);原创 2014-12-07 12:08:24 · 5892 阅读 · 0 评论 -
自增自减运算符
x = x+++y+++x++; printf ( "x=%d,z=%d,y=%d\n", x,z,y); y= ++x + ++y; printf ( "x=%d,y=%d\n", x,y); x = x-- +y-- +x--; printf ( "x=%d,z=%d,y=%d\n", x,z,y); y = --x+--y; printf ( "x=%d,z=%d,y=原创 2016-02-23 08:52:14 · 410 阅读 · 0 评论 -
auto_ptr 源码解析
就是acclerated c++中所说的 通用句柄类,具体见注释! #define _THROW0() noexcept template class auto_ptr; template struct auto_ptr_ref { // proxy reference for auto_ptr copying explicit auto_ptr_ref(_Ty *_Right)原创 2016-08-29 20:17:34 · 494 阅读 · 0 评论 -
c/c++ 指针 归纳一
// cpp-test.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" void print_array_elment(int a[3], int size) { /*数组作为形参时,退化为指针,不能通过sizeof获取数组的内存大小 ,获取的是指针的大小,commented by zhaoyulong,2016.8.14*/ printf("\n原创 2016-08-14 21:05:59 · 888 阅读 · 0 评论 -
std::chrono时间相关
#define _XTIME_NSECS_PER_TICK 100 #define _XTIME_TICKS_PER_TIME_T (long long)10000000 时钟 system_clock steady_clock high_resolution_clock typedef steady_clock high_resolution_clock; chrono::system_cl...原创 2019-10-01 22:46:09 · 710 阅读 · 0 评论