随笔分类 -  c/c++

c和c++的学习博客
摘要:C/C++ 开放库 1、 "Best C/C++ Network Library" 2、 "A list of open source C++ libraries" 阅读全文
posted @ 2017-09-05 14:31 xiulug 阅读(203) 评论(0) 推荐(0) 编辑
摘要:C++ 'explicit' 关键字 1 作用 2 实例 参考: "What does the explicit keyword mean'?" 阅读全文
posted @ 2017-08-31 17:58 xiulug 阅读(137) 评论(0) 推荐(0) 编辑
摘要:C++ Websites C++ 推荐网站 1、cprogramming.com 2、cppreference.com 3、cplusplus.com 4、 "Boost C++ Library" 阅读全文
posted @ 2017-08-31 13:55 xiulug 阅读(168) 评论(0) 推荐(0) 编辑
摘要:C++ smart pointer 什么是 smart pointer/智能指针? 1、定义 2、实现 3、应用 "std::shared_ptr" 阅读全文
posted @ 2017-08-31 09:48 xiulug 阅读(235) 评论(0) 推荐(0) 编辑
摘要:"Use of 'Const' in Function Return Values" 为什么要在函数的返回值类型中添加Const? 1、Features Of the possible combinations of pointers and ‘const’, the constant pointe 阅读全文
posted @ 2017-08-28 13:02 xiulug 阅读(206) 评论(0) 推荐(0) 编辑
摘要:函数尾部的const是什么意思? 1 Answer by "Jnick Bernnet" A "const function", denoted with the keyword const after a function declaration, makes it a compiler erro 阅读全文
posted @ 2017-08-28 11:30 xiulug 阅读(264) 评论(0) 推荐(0) 编辑
摘要:C语言 宏/macor/ define 高级技巧 1、在进行调试的时候,需要进行打印/PRINT,可以通过define进行自定义。例如,自己最常用的DEBUG_PRINT() 这是一个variable arguments的printf,可以像使用库函数一样使用DEBUG_PRINT()。 2、Pas 阅读全文
posted @ 2016-11-02 16:44 xiulug 阅读(407) 评论(0) 推荐(0) 编辑
摘要:C语言 goto, return等跳转 Please don't fall into the trap of believing that I am terribly dogmatical about [the go to statement]. I have the uncomfortable f 阅读全文
posted @ 2016-09-13 16:35 xiulug 阅读(323) 评论(0) 推荐(0) 编辑
摘要:enum 与 define 一、为什么既要有enum,又要define enum is derived from , from + ,字面意思就是 。 阅读全文
posted @ 2016-09-12 10:33 xiulug 阅读(389) 评论(0) 推荐(0) 编辑
摘要:C Plus Plus 基础 一、变量和基本类型 1、const 限定符号 const constant(中文意思:不停的,不断的,一直不变的) ①代替Magic Number(即『无意义的常数』),提高程序的可读性。 ②使 变量/varibale 变成一个「值 不可更改」的 常量/const 或 阅读全文
posted @ 2016-09-11 16:57 xiulug 阅读(255) 评论(0) 推荐(0) 编辑
摘要:C语言中的%0nd printf formatted print /格式化输出 一、十进制 d decimal/十(shí)进制 结果如下: 二、十六进制 x hexadecimal,其中hexadecimal来自于 古希腊 ,这个词语 is composed of hexa , derived f 阅读全文
posted @ 2016-09-09 11:19 xiulug 阅读(1682) 评论(0) 推荐(0) 编辑
摘要:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-04-27 17:33 xiulug 阅读(140) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2015-04-27 17:30 xiulug 编辑
摘要:函数简介 函数名: time 头文件:time.h 函数原型:time_t time(time_t * timer) 功能: 获取当前的系统时间,返回的结果是一个time_t类型,其实就是一个大整数,其值表示从CUT(Coordinated Universal Time)时间1970年1月1日00:00:00(称为UNIX系统的Epoch时间)到当前时刻的秒数。然后调用localtime将time_t所表示的CUT时间转换为本地时间(我们是+8区,比CUT多8个小时)并转成struct tm类型,该类型的各数据成员分别表示年月日时分秒。 补充说明:time函数的原型也可以理解为 lo... 阅读全文
posted @ 2012-11-12 16:49 xiulug 阅读(66171) 评论(0) 推荐(2) 编辑
摘要:很多C++书籍中都介绍过,一个Class对象需要占用多大的内存空间。最权威的结论是:*非静态成员变量总合。(not static)*加上编译器为了CPU计算,作出的数据对齐处理。(c语言中面试中经常会碰到内存对齐的问题)*加上为了支持虚函数(virtual function),产生的额外负担。下面给出几个程序来看一下:#include <iostream>#include <cstdio>#include <string>using namespace std;class Car1{};void fun1(void){ int size =0; Car1 o 阅读全文
posted @ 2012-10-24 18:13 xiulug 阅读(2542) 评论(0) 推荐(1) 编辑

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