07 2016 档案

在赋值运算符函数中,类的实例能直接访问私有数据成员???
摘要:印象中,private的数据成员只能在类的成员函数中使用,无法通过类的对象直接访问!(错误理解) 正确的理解是:在类的成员函数中,可以直接访问私有成员。即只要在该类的成员函数中,无论是直接访问该类的私有数据成员,还是访问某个对象(必选是该类型)的私有数据成员,均是可以的!!! 借鉴网上(http:/ 阅读全文

posted @ 2016-07-21 06:37 whl-hl 阅读(823) 评论(0) 推荐(0)

371. Sum of Two Integers
摘要:1. 问题描述 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example: Given a = 1 and b = 2, return 3.Tags:B 阅读全文

posted @ 2016-07-20 23:58 whl-hl 阅读(166) 评论(0) 推荐(0)

342. Power of Four
摘要:1. 问题描述 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, r 阅读全文

posted @ 2016-07-17 22:09 whl-hl 阅读(284) 评论(0) 推荐(0)

326. Power of Three
摘要:1. 问题描述 Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?Tags: M 阅读全文

posted @ 2016-07-14 22:26 whl-hl 阅读(182) 评论(0) 推荐(0)

231. Power of Two
摘要:1. 问题描述 Given an integer, write a function to determine if it is a power of two.Tags: Math Bit ManipulationSimilar Problems: (E) Number of 1 Bits (E) 阅读全文

posted @ 2016-07-12 23:05 whl-hl 阅读(168) 评论(0) 推荐(0)

191. Number of 1 Bits
摘要:1. 问题描述 Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 阅读全文

posted @ 2016-07-03 22:36 whl-hl 阅读(127) 评论(0) 推荐(0)

导航