上一弹地址:
https://blog.csdn.net/点我访问/article/details/105419638
········································································································································································································································································································································································································································································································································································································································································································
C/C++
32. 当真?
你肯定听说过标识符只能有以下一些组成:
qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM2345678901
但是,以下语句在C/C++(我用的是GCC)中是合法的:
_$(int $,char** $$){int $$$=$;return $$[$$$];}
(我绝对没用VC)
33. 又是奇怪的东西
//only run on windows or linux
#include<stdio.h>
char gc(){
getchar();
#ifdef _WIN32
return (stdin->_ptr)[-1];
#else
return (stdin->ptr)[-1];
#endif
}
这就是“不用char c=getchar()也知道返回值”
34.任何在行末的\
都是合法的
while(x--> \
\
\
\
\
0){
printf("%d",x);
}
35.为所欲为的#define
#define x(v)
x(@#$%^&*&^%$#@!~!@#$%^7`1`1
x)
完全合法
36.无尽的bug(c++)
i<i<i<i<i<i<i> > > > > >
37.hack库
//举例子,stdio.h中,
#ifndef _FILE_DEFINED
struct _iobuf {
//……
};
typedef struct _iobuf FILE;
#define _FILE_DEFINED
#define _FILE_DEFINED
typedef struct _iobuf{/*...*/}FILE;
#include<stdio.h>
python
38.python解释器实现python解释器
while 1:
try:
exec(input(">>>").replace("\\t","\t").replace("\\n","\n"))
except BaseException as e:
print(e)
continue
else:
pass
finally:
pass