The signum of a number is 1 if the number is positive, –1 if it is negative, and 0 if it is zero. Write a function that computes this value.
What is the value of an empty b……继续阅读 »
shadamao
7年前 (2017-02-24) 224927浏览 0评论
36个赞
In the Scala REPL, type 3. followed by the Tab key. What methods can be applied?
In the Scala REPL, compute the square root of 3, and then square that value. By how much doe……继续阅读 »
shadamao
7年前 (2017-02-23) 1893浏览 0评论
0个赞
今天碰到个有趣的问题,看下面的代码
输出是什么的?
在gcc clang vcc下各不相同,在gcc 下是1 clang和vcc 下是 0,那为什么呢? 原因是 m[0] 和m.size()的计算顺序不同,在gcc 下先计算m[0],而在clang中先计算m.size() 这个计算顺序在c++17之前是没有定义的
类似下面的代码,结果都是undefined
……继续阅读 »
shadamao
7年前 (2017-02-04) 1600浏览 0评论
0个赞
没有考虑 右值引用的问题,可以方便使用c++操作mysql
github 地址 https://github.com/yangzhg/SQLOperator
用法
sql_operator.h
sql_operator.cpp
sql_operator_test.cpp
……继续阅读 »
shadamao
7年前 (2017-01-21) 1635浏览 0评论
0个赞