literals-1.c

来自「Mac OS X 10.4.9 for x86 Source Code gcc」· C语言 代码 · 共 29 行

C
29
字号
/* Test that (what looks like) comments are not recognized in literals   and that quotes within quotes do not confused the preprocessor.  *//* { dg-do run } */extern void abort (void);int main (){  const char *str1 = "/*";  const char *str2 = "'";  if (str1[0] != '/' || str1[1] != '*' || str1[2] != '\0')    abort ();  if (str2[0] != '\'' || str2[1] != '\0')    abort ();#if '"' != '\"'#  error /* { dg-bogus "error" "double quote in charconst" } */#endif#if !'\''#  error quote /* { dg-bogus "quote" "quote in charconst" } */#endif  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?