1.expected identifier before numeric constant
一般情况下是枚举类型中的某个变量已经被#define定义过一次了,在项目空间中搜索你枚举类型中的所有变量类型,看看是否被#define过,如果被#define过,就把#define的删除或换个名字。
分类:
其他好文 时间:
2014-06-13 14:15:10
阅读次数:
201
看到const关键字,C++程序员首先想到的可能是const常量。这可不是良好的条件反射。如果只知道用const定义常量,那么相当于把火药仅用于制作鞭炮。const更大的魅力是它可以修饰函数的参数、返回值,甚至函数的定义体。const是constant的缩写,“恒定不变”的意思。被const修饰的东西都受到强制保护,可以预防意外的变动,能提高程序的健壮性和高效性。所以很多C++程序设计书籍建议:“...
分类:
编程语言 时间:
2014-06-11 06:00:43
阅读次数:
331
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant...
分类:
其他好文 时间:
2014-06-10 07:42:16
阅读次数:
244
Sort a linked list inO(nlogn) time using
constant space complexity.单向链表排序O(nlogn),Mergesort可以实现。 1 /** 2 * Definition for
singly-linked list. 3 * st.....
分类:
其他好文 时间:
2014-06-10 00:44:11
阅读次数:
329
C++const 关键字小结const
是constant的缩写,本意是不变的,不易改变的意思。const
在C++中是用来修饰内置类型变量,自定义对象,成员函数,返回值,函数参数。一、const修饰普通类型的变量。如下:1 const int a = 7; 2 3
int b = a; //i.....
分类:
编程语言 时间:
2014-06-09 20:58:05
阅读次数:
281
Sort a linked list in O(n log n) time using
constant space
complexity.一谈到时间复杂度O(nlogn),立即联想到以下3种排序方法:1.归并排序(基于分治):时间复杂度O(nlogn),归并排序的最好、平均、最坏时间复杂度没有差别...
分类:
其他好文 时间:
2014-06-09 20:37:31
阅读次数:
244
php常量在php中使用define(string constant_name,mixed
value
,case_sensitive=true)来定义常量;define()函数参数说明:参数说明constant_name必选参数。常量名称,即标识符value必选参数。常量的值。case_sensi...
分类:
其他好文 时间:
2014-06-09 18:35:14
阅读次数:
172
【题目】
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only use constant extra space.
For example,
Given the following binary tre...
分类:
其他好文 时间:
2014-06-08 15:46:22
阅读次数:
303
Sort a linked list inO(nlogn) time using
constant space complexity./** * Definition for singly-linked list. * struct
ListNode { * int val; * L...
分类:
其他好文 时间:
2014-06-06 20:01:30
阅读次数:
333
1.const
表示的是常量(constant),始终不会发生改变,在编译时就确定了。所以类中定义一个常量可以被类访问也可以被类的实例访问。定义时就不能和static一起用。如果用了也是没有作用的,所以语法就规定其是无效的。在声明时同时初期化。
private const string Name=....
分类:
其他好文 时间:
2014-06-02 19:45:46
阅读次数:
201