摘要: new int;//开辟一个存放整数的存储空间,返回一个指向该存储空间的地址(即指针) new int(100);//开辟一个存放整数的空间,并指定该整数的初值为100,返回一个指向该存储空间的地址 new char[10];//开辟一个存放字符数组(包括10个元素)的空间,返回首元素的地址 new int[5][4];//开辟一个存放二维整型数组(大小为5*4)的空间,返回首... 阅读全文
posted @ 2016-07-03 23:24 绵绵思远道 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 题目: 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, retur 阅读全文
posted @ 2016-07-03 23:05 绵绵思远道 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目: 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? 答案: 判断一个数 阅读全文
posted @ 2016-07-03 22:58 绵绵思远道 阅读(152) 评论(0) 推荐(0) 编辑