//函数调用 bind&functionvoid fun(){ CCLOG("Hello cocos"); return;}std::function f = std::bind(fun);fun();-------------------void fun1(){ int numb...
分类:
其他好文 时间:
2014-06-21 09:55:02
阅读次数:
166
按值传递地址传递:应该明白只有这2种传递,下面讨论函数的按值传递#include #include int add_rtVal(int a,int b){ int c = 0; c = a + b; return c;}int main(int argc,char* argv[])...
分类:
编程语言 时间:
2014-06-21 09:28:38
阅读次数:
267
/** * 验证用户是否有输入回车键,并给出相应提示 * @param flag * @return */import java.io.BufferedReader; import java.io.InputStreamReader;public class Test { public stat.....
分类:
编程语言 时间:
2014-06-21 09:24:01
阅读次数:
245
1 --逻辑表达式 2 3 --1+2+3+...+n 4 function fun1(n) 5 local sum = 0 6 for i=1,n do 7 sum = sum + i 8 end 9 return sum 10...
分类:
其他好文 时间:
2014-06-21 08:04:22
阅读次数:
292
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Def...
分类:
其他好文 时间:
2014-06-21 07:55:42
阅读次数:
197
Given a sorted linked list, delete all duplicates such that each element appear only once.For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3...
分类:
其他好文 时间:
2014-06-21 07:30:11
阅读次数:
157
Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat...
分类:
其他好文 时间:
2014-06-21 07:17:47
阅读次数:
210
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or...
分类:
其他好文 时间:
2014-06-21 06:58:22
阅读次数:
186
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not...
分类:
其他好文 时间:
2014-06-21 06:40:07
阅读次数:
172
def main(): try: print "try" return True except: print "except" finally: print "finally" print "main"输出:tryfinally就算try中有return语句,最终的finally也会被执行。其他.....
分类:
编程语言 时间:
2014-06-20 14:00:25
阅读次数:
210