<script> function myFunction() { var x1=event.clientX;//只需要将被调用的变量前的var删除即可在下个函数调用: document.getElementById("demo").innerHTML=x1; console.log(x1,'asdasdasd'); }; function hhh(){ var x1=window.x1; //这种调用方式无效 var x2=event.clientX; //判断鼠标按住/
一,宏定义:在预处理的时候把宏定义的内容替换到代码中,正常编译. 1,无参数宏定义和有参数宏定义 (1)宏定义不能加分号,比如:#define PI 3.24;错的,#define PI 3.24对的. (2)带参数宏定义,注意参数用括号包起来,因为参数有可能表达式:宏名和形参之间不能有空格. (3)带参数宏定义和带参数的函数,在使用时候有差别的. 带参数函数示例: #include <stdio.h> int SQ(int); int main() { ; ) printf("
1.Preprocessor Glue: The ## Operator 预处理连接符:##操作符 Like the # operator, the ## operator can be used in the replacement section of a function-like macro.Additionally, it can be used in the replacement section of an object-like macro. The ## operator co