• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






canexjtuzju

记录
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页

2014年8月2日

c++笔记--重载箭头运算符
摘要: 箭头操作符(->)的通常用法是,使用一个类对象的指针来调用该指针所指对象的成员。左操作数为对象指针,右操作数为该对象的成员。定义重载箭头操作符之后看起来就有点特别,可以用类对象的指针来调用,也可以用类对象直接调用。重载箭头操作符,首先重载箭头操作符必须定义为类成员函数。箭头操作符可能看起来是二元操作... 阅读全文
posted @ 2014-08-02 15:40 canexjtuzju 阅读(545) 评论(0) 推荐(0)
 

2014年8月1日

从LLVM源码学C++(六)
摘要: 今天看clang的有关DeclSpec.h,看到有关关键字的一些信息。这里总结一下知识点:各种关键字C++关键字(static/register/atuo/extern/volatile/const)释疑 下面关于C++的几个关键字是经常和我们打交道的而我们又经常对这些含糊不清的, 本文根据自己的学... 阅读全文
posted @ 2014-08-01 14:21 canexjtuzju 阅读(285) 评论(0) 推荐(0)
 
LeetCode--Longest Palindromic Substring
摘要: 有一个比较容易出错的点:反转求最长公共子序列,这是错误的想法 1 class Solution { 2 public: 3 string longestPalindrome(string s) { 4 int n = s.length(); 5 int lon... 阅读全文
posted @ 2014-08-01 13:34 canexjtuzju 阅读(126) 评论(0) 推荐(0)
 
LeetCode--Palindrome Number
摘要: 关键:如何取最高位的数? 1 class Solution { 2 public: 3 bool isPalindrome(int x) { 4 if(x = 10) 9 {10 div = div*10;11 ... 阅读全文
posted @ 2014-08-01 13:07 canexjtuzju 阅读(140) 评论(0) 推荐(0)
 

2014年7月31日

LeetCode--Single Number II
摘要: 思路:统计每位出现的次数,mod3;对于k同样适用 1 class Solution { 2 public: 3 int singleNumber(int A[], int n) { 4 int a[32] = {0}; 5 int i = 0; 6 ... 阅读全文
posted @ 2014-07-31 11:31 canexjtuzju 阅读(122) 评论(0) 推荐(0)
 

2014年7月30日

LeetCode--Single Number
摘要: 1 class Solution { 2 public: 3 int singleNumber(int A[], int n) { 4 int i; 5 int ans = 0; 6 for(i = 0 ; i < n ; ++i) 7 ... 阅读全文
posted @ 2014-07-30 15:49 canexjtuzju 阅读(112) 评论(0) 推荐(0)
 

2014年7月28日

从LLVM源码学C++(五)
摘要: 知识点:static,const,static const详解:转(http://blog.csdn.net/yjkwf/article/details/6067267)const定义的常量在超出其作用域之后其空间会被释放,而static定义的静态常量在函数执行后不会释放其存储空间。 static表... 阅读全文
posted @ 2014-07-28 16:28 canexjtuzju 阅读(508) 评论(0) 推荐(0)
 
从LLVM源码学C++(四)
摘要: 关键知识点:断言1 const Option OptTable::getOption(OptSpecifier Opt) const {2 unsigned id = Opt.getID();3 if (id == 0)4 return Option(0, 0);5 assert... 阅读全文
posted @ 2014-07-28 15:18 canexjtuzju 阅读(683) 评论(0) 推荐(0)
 
从LLVM源码学C++(三)
摘要: 关键知识点:mutable关键字mutable关键字:mutalbe的中文意思是“可变的,易变的”,跟constant(既C++中的const)是反义词。 在C++中,mutable也是为了突破const的限制而设置的。被mutable修饰的变量,将永远处于可变的状态,即使在一个const函数中。... 阅读全文
posted @ 2014-07-28 14:45 canexjtuzju 阅读(320) 评论(0) 推荐(0)
 
从LLVM源码学C++(二)
摘要: 在看Clang源码的过程中遇到过,返回const引用,于是就去google 了一下返回值以及参数传递等相关的知识。首先,为什么要(const 引用)的返回值?首先&的引用作用是C++独有的特性。其作用相当于传入参数时不经过拷贝,而是实实在在的传入。fun(int &a)。如果在函数内部修改了a的值,... 阅读全文
posted @ 2014-07-28 14:02 canexjtuzju 阅读(482) 评论(0) 推荐(0)
 
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页