Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
GCC 4.7 字符串文字的源字符编码和执行字符编码?
Linux x86 64 上的 GCC 4 7 是否具有默认字符编码 用于验证和解码 C 源文件中字符串文字的内容 这是可配置的吗 此外 当将字符串数据从字符串文字链接到输出的数据部分时 它是否具有默认的执行字符编码 这是可配置的吗 在任何
c
Linux
gcc
characterencoding
stringliterals
字符串文字:它们去了哪里?
我对字符串文字的分配 存储位置感兴趣 我确实找到了一个有趣的答案here https stackoverflow com questions 51592 is there a need to destroy char string or c
c
memory
stringliterals
在 C++ 中处理字符串时如何使用 memset? [关闭]
Closed 这个问题是无法重现或由拼写错误引起 help closed questions 目前不接受答案 我有Python背景 最近在学习C 我正在学习一个名为的 C C 函数memset并遵循网站上的在线示例https www gee
c
initialization
cstrings
stringliterals
memset
C++ 字符串字面量相等检查?
不是我们比较两个数组的方式 因为那只会比较地址 include
c
Arrays
Compare
stringliterals
我应该将 std::string 与“string”或“string”进行比较吗?
考虑这个代码片段 bool foo const std string s return s hello comparing against a const char literal bool bar const std string s r
c
c14
C17
stringcomparison
stringliterals
指向常量字符的指针
下面的代码指向a中的第一个字符字符数组可在只读存储器中使用 是对的吗 const char ptr String one 现在 当ptr开始指向另一个内存位置 ptr String two 第一个会发生什么字符数组 执行结束时该内存位置是否
c
pointers
char
stringliterals
字符串驻留和文字字符串声明的搜索成本
两个问题 当我们声明文字字符串时 我们会在堆的字符串池中查找是否有相同的字符串 这也是实习吗 班级的方法实习生String 在我看来 每个文字字符串声明都需要进行二分搜索或其他操作 因此它至少需要花费log n when n是池中现有字符串
Java
performance
Search
stringliterals
stringinterning
为什么 gcc 允许使用大于数组的字符串文字初始化 char 数组?
int main char a 7 Network return 0 A 字符串字面量在 C 中是内部终止的空字符 因此 上面的代码应该给出编译错误 因为字符串文字的实际长度Network是 8 并且它不能放入char 7 array 然而
c
compilererrors
stringliterals
Arrays
C++11 中字符串文字的 Unicode 编码
继一个相关问题 https stackoverflow com questions 6794590 how does file encoding affect c11 string literals 我想问一下C 11中新的字符和字符串文字
c
Unicode
C11
UTF
stringliterals
是否可以使用有条件选择的字符串文字来初始化字符数组?
我知道初始化一个是完全有可能的char带有字符串文字的数组 char arr foo C 11 8 5 2 1 是这样说的 A char数组 无论是普通char signed char or unsigned char char16 t a
c
languagelawyer
stringliterals
C++:从模板参数生成字符串文字
template lt unsigned int i gt struct t static const char s template lt unsigned int i gt const char t i s where 是 0 1 2
c
templates
metaprogramming
stringliterals
字符串文字和数组的地址
int main char str1 Hi str2 Bye printf u u n str1 str1 int arr 5 1 2 3 4 5 printf u u arr arr 这里发生了什么 str and str给出不同的地址和
c
Arrays
string
pointers
stringliterals
C++ 比较两个字符串文字
将一个字符串文字与另一个字符串文字进行比较时 运算符 或 结果是否明确定义 例如 以下内容是否保证成立 assert a a assert a b 请不要说 使用 std string 之类的东西 我只是想知道这个具体案例 a a 这个表达
c
stringliterals
如何编写多行字符串文字
有没有办法在 C 中使用 Perl 那样的多行纯文本 常量文字 也许有一些解析技巧 include正在读取一个文件 我知道你可以用 C 11 中的原始字符串来做到这一点 嗯 有点 最简单的方法是仅使用相邻字符串文字由编译器连接的事实 con
c
stringliterals
rawstring
antlr 文字字符串匹配:我做错了什么?
我已经使用antlr 3天了 我可以解析表达式 编写侦听器 解释解析树 这是梦想成真 但后来我尝试匹配文字字符串 foo 但失败了 我可以找到很多声称可以做到这一点的例子 我都试过了 所以我创建了一个小项目来匹配文字字符串 我一定是在做一些
antlr4
stringliterals
跨越多行的字节字符串
我需要解析源代码中跨越不止一行的字节字符串 像这样 self file write b compdef s n n arguments s A n self cmdName 该行抛出以下异常 builtins SyntaxError can
python
python3x
literals
stringliterals
字符串文字的地址长度
我发现在带有 GCC 的 Linux 系统上 字符串文字的地址似乎比其他变量小得多 例如 以下代码生成下面所示的 o p include
c
gcc
memory
constants
stringliterals
来自文字的静态 std::string 对象的宏
假设我需要调用一个函数foo这需要一个常量std string我的代码中很多地方都引用了 int foo const std string foo bar foo baz 使用像这样的字符串文字调用函数将创建临时的std string对象
c
macros
cpreprocessor
stdstring
stringliterals
结构体与字符串文字?只读与读写? [复制]
这个问题在这里已经有答案了 C99 标准是否允许写入复合文字 结构 它似乎不提供对文字字符串的写入 我问这个是因为它说C 编程 现代方法 第二版 http knking com books c2 index html第 406 页 问 允许
c
C99
stringliterals
compoundliterals
如何定义取决于模板参数的字符类型的字符串文字?
template
c
C11
stringliterals
1
2
3
»