什么是立即执行函数 声明一个函数,并马上调用这个匿名函数就叫做立即执行函数。在定义好一个函数后,直接执行。 用声明一个函数,用括号包起来,调用此函数。 立即执行函数的写法 有时候,我们定义函数以后,立即调用该函数,这时不能在函数的定义后面直接加圆括号,这会产生语法错误。产生语法错误的原因是,func ...
分类:
其他好文 时间:
2019-12-23 13:36:48
阅读次数:
114
一、JavaScript作用域: 1.就是代码名字(变量)在某个范围内起作用和效果,目的是为了提高程序的可靠性更重要是减少命名冲突。 2.js的作用域(es6)之前,分为全局作用域、局部作用域 全局作用域:整个script标签,或者是一个单独的js文件 。 var num='全局作用域'; 局部作用 ...
分类:
编程语言 时间:
2019-12-22 18:17:49
阅读次数:
69
#include <stdio.h> #include <stdlib.h> const int N=5; // 定义结构体类型struct student,并定义STU为其别名 typedef struct student { long no; char name[20]; int score; ...
分类:
其他好文 时间:
2019-12-22 14:55:46
阅读次数:
92
构造函数 + 构造和析构概念语法 + 构造函数的分类 + 有参构造函数3种调用方法 + 拷贝构造函数4种调用时机 场景1和2:A a(b); A a = b; 场景3:形参是一个元素,实参传递给形参 场景4:函数返回值返回一个元素,匿名对象 匿名对象的去和留 对象的初始化 和 对象的=操作 是两个不 ...
分类:
编程语言 时间:
2019-12-21 14:04:39
阅读次数:
85
看到下面的语法,其他语言都没见过这种语法 然后在stack overflow上看到使用冒号的各种情形: https://stackoverflow.com/questions/17034475/in-c-sharp-what-category-does-the-colon-fall-into-and ...
分类:
其他好文 时间:
2019-12-21 11:36:21
阅读次数:
87
mysql 1. 卸载旧版本 rpm -qa | grep mysql 检查是否有旧版本 查询结果:mysql-libs-5.1.73-7.el6.x86_64 rpm -e mysql-libs 删除旧版本 rpm -e --nodeps mysql-libs 强行删除 2. 安装mysql 2. ...
分类:
数据库 时间:
2019-12-20 22:21:53
阅读次数:
163
// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i ...
分类:
其他好文 时间:
2019-12-18 00:13:41
阅读次数:
102
Part2: ex2_1_1 // 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int i ...
分类:
其他好文 时间:
2019-12-18 00:04:52
阅读次数:
76
// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include <stdio.h> #include <stdlib.h> const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 i ...
分类:
编程语言 时间:
2019-12-17 23:57:39
阅读次数:
152
// 练习:使用二分查找,在一组有序元素中查找数据项 // 形参是数组,实参是数组名 #include<stdio.h> #include <stdlib.h>const int N=5; int binarySearch(int x[], int n, int item); // 函数声明 int ...
分类:
其他好文 时间:
2019-12-17 22:46:14
阅读次数:
147