摘要: 有如下C++函数声明static int greatest_common_divisor(int &a, int &b);如下调用方式报错:Assert::AreEqual(6, CppAlgorithms::greatest_common_divisor(18, 12), L"Expect result is 6.");" initial value of reference to non const must be lvalue "究其原因是 引用类型变量如果不是const, 必须赋以左值。 int a = 18, a 是左值,18是 阅读全文
posted @ 2013-06-14 22:04 ahguo 阅读(1581) 评论(0) 推荐(0) 编辑