稀奇古怪的新特性,菜鸟在此啄上一啄. 1. When should literal classes be used in C++? 2. int i; // not constant const int size = i; // fine! 可以,但为什么不在这里就先判断出问题的隐患呢? int arr[size]; // Error! 然而对于constexpr,则表明这个值不仅是constant的,而且也是编译期确定的 int i; // not constant constexpr i…
The open source, cross platform, free C++ IDE. Code::Blocks is a free C++ IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable. Finally, an IDE with all the features you need, having a c…
#include <iostream> using namespace std; int main() { using cullptr = const unsigned long long *; //C++11新变量类型long long;constexpr unsigned long long * 为非法 typedef wchar_t * wchptr; /* 使用using或typedef声明的类型别名的变量实例初始化时,不同类型变量不可使用","写在同一行 如://…
今天cocos2d-x打包 android的时候报错:format not a string literal and no format arguments 报错点是:__String::createWithFormat(s_szFuWenEffect2[GetType()])->getCString() 代码vs2015编译是通过的,没任何问题. 修改方法:__String::createWithFormat("%s", s_szFuWenEffect2[GetType()])…
在Android Studio2.2 进行NDK编程,在对*char 字符串 进行日志输出时,报错: error: format not a string literal and no format arguments [-Werror=format-security] 代码: 网上说是版本不兼容导致的!搜索了下解决 方法如下: 解决方法: 在你的ndk目录下修改build/core/default-build-commands.mk TARGET_FORMAT_STRING_CFLAGS :=…
自C++11起,我们可以定义 raw string 字符串字面常量. Raw string 允许我们定义所见即所得的字符串字面常量,从而可以省下很多用来修饰特殊 字符的符号. Raw string 以 R"( 开头,以 )" 结尾,可以内含 line break.例如一个用来表示”两个反 斜线和一个n“的寻常字面常量可以定义如下: "\\\\n" 也可以定义它为如下 raw string literal: R"(\\n)" 如果要在 raw st…