C语言最无聊的地方

tomljr 2011-11-01 09:49:12
??=include <iostream>
using namespace std;
void Swap(int *a,int *b);

void main(void)
{
int Aa=748,Bb=174;
void (*p)(int*,int*)=NULL;
printf("Aa= %d,Bb= %d??/n",Aa,Bb);
p=Swap;
p(&Aa,&Bb);
printf("Aa= %d,Bb= %d??/n",Aa,Bb);
}

void Swap(int *a,int *b)
{
*a=*a??'*b;
*b=*b??'*a;
*a=*a??'*b;
}
...全文
196 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
gengchenhui 2011-11-01
  • 打赏
  • 举报
回复
C语言可以using namespace std;
这样?
xjdreamer 2011-11-01
  • 打赏
  • 举报
回复
哇 还有这回事
绿领巾童鞋 2011-11-01
  • 打赏
  • 举报
回复
恩,多多谅解
hongwenjun 2011-11-01
  • 打赏
  • 举报
回复
?和/ 共用一键的
所以?? 应该是表示 // 再加个 =
组成 #
pathuang68 2011-11-01
  • 打赏
  • 举报
回复
历史遗留问题。
siasjack 2011-11-01
  • 打赏
  • 举报
回复
那几个问号是怎么回事?编译器的问题?
自信男孩 2011-11-01
  • 打赏
  • 举报
回复
问题奇怪的地方是?号吗?
luciferisnotsatan 2011-11-01
  • 打赏
  • 举报
回复
历史遗留问题,一点也不无聊,过去有些输入设备上没有#之类的按键。
  • 打赏
  • 举报
回复
没啥无聊的,以前不见得所有键盘都有 特殊符号的
tomljr 2011-11-01
  • 打赏
  • 举报
回复
最新的C标准已经不支持三字母词,故VS2010编译不过。
赵4老师 2011-11-01
  • 打赏
  • 举报
回复
Trigraphs
The source character set of C source programs is contained within the 7-bit ASCII character set but is a superset of the ISO 646-1983 Invariant Code Set. Trigraph sequences allow C programs to be written using only the ISO (International Standards Organization) Invariant Code Set. Trigraphs are sequences of three characters (introduced by two consecutive question marks) that the compiler replaces with their corresponding punctuation characters. You can use trigraphs in C source files with a character set that does not contain convenient graphic representations for some punctuation characters.

Table 1.1 shows the nine trigraph sequences. All occurrences in a source file of the punctuation characters in the first column are replaced with the corresponding character in the second column.

Table 1.1 Trigraph Sequences

Trigraph Punctuation Character
??= #
??( [
??/ \
??) ]
??’ ^
??< {
??! |
??> }
??- ~


A trigraph is always treated as a single source character. The translation of trigraphs takes place in the firsttranslation phase, before the recognition of escape characters in string literals and character constants. Only the nine trigraphs shown in Table 1.1 are recognized. All other character sequences are left untranslated.

The character escape sequence, \?, prevents the misinterpretation of trigraph-like character sequences. (For information about escape sequences, see Escape Sequences.) For example, if you attempt to print the string What??! with this printf statement

printf( "What??!\n" );

the string printed is What| because ??! is a trigraph sequence that is replaced with the | character. Write the statement as follows to correctly print the string:

printf( "What?\?!\n" );

In this printf statement, a backslash escape character in front of the second question mark prevents the misinterpretation of ??! as a trigraph.

70,024

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧