1.main(){ int a[5]={1,2,3,4,5}; int *ptr=(int *)(&a+1); printf("%d,%d",*(a+1),*(ptr-1));}答:2,5 *(a+1)就是a[1],*(ptr-1)就是a[4],执行结果是2,5 &a+1不是首地址+1,系统会认为....
分类:
移动开发 时间:
2014-10-04 00:50:55
阅读次数:
383
//构造缓存函数var memoizer = function (memo, fundamental) { var shell = function (n) { var result = memo[n]; if (typeof result !== 'number'...
分类:
编程语言 时间:
2014-10-03 23:50:35
阅读次数:
261
c++命令提示符窗口下打印指定大小的菱形代码VS2010下,新建空项目,添加源文件,将代码粘贴进去就可以了。通过改maxRows值的大小,可以控制菱形的大小#include
#include //添加依赖的头文件
void main()
{
int i,j,k;
int maxRows = 12;//控制菱形的大小
//先打印上边的四行
for(i=1;i<maxRows;i+...
分类:
编程语言 时间:
2014-10-03 21:27:15
阅读次数:
220
char CLinkListDelete(CircularLinkList &CL){ //删除表尾元素 if(CL->next == CL) { printf("List is EMPTY!\n"); return 0; ...
分类:
编程语言 时间:
2014-10-03 19:22:55
阅读次数:
149
MIT的C指针练习代码
觉得很好的代码,贴出来. 大概瞄了一眼,感觉不是很难 现在比较忙,以后做解析(如果有必要的话)
#include
#include
void
f(void)
{
int a[4];
int *b = malloc(16);
int *c;
int i;
printf("1: a = %p, b =...
分类:
其他好文 时间:
2014-10-03 18:03:04
阅读次数:
205
1.什么是Windows BATCHBATCH也就是批处理文件,有时简称为BAT,是Windows平台上的一种可运行脚本,与*nix(Linux和Unix)上的Shell脚本和其它的脚本(Perl,Python)等是一样的,实质上就是一个文本文件,可是用特定的软件去解释的时候,就变成了可运行脚本。在...
编程输入三角形的三条边,判断它们能否构成三角形。若可以构成三角形,指出是何种三角形:等腰三角形,直角三角形,还是一般三角形?
C语言实现如下:
#include
#include
#define EPS 1e-7
int main(){
float a, b, c;
int flag = 1;
printf("Input a, b, c: ");
scanf("%f,%f,%...
分类:
其他好文 时间:
2014-10-03 16:13:34
阅读次数:
263
#!/bin/sh## mysqld This shell script takes care of starting and stopping# the MySQL subsystem (mysqld).## chkconfig: - 64 36# description: MySQL data....
分类:
数据库 时间:
2014-10-03 16:06:44
阅读次数:
407
bashrc与profile的区别要搞清bashrc与profile的区别,首先要弄明白什么是交互式shell和非交互式shell,什么是login shell 和non-login shell。交互式模式就是shell等待你的输入,并且执行你提交的命令。这种模式被称作交互式是因为shell与用户进...
分类:
系统相关 时间:
2014-10-03 13:00:24
阅读次数:
284
Bash安全漏洞故障处理方法一:漏洞描述该漏洞源于你调用的bash shell之前创建的特殊的环境变量,这些变量可以包含代码,同时会被bash执行。二:已确认被成功利用的软件及系统所有安装gunbash版本小于或者等于4.3的linux操作系统。三:漏洞检测方法[root@localhost ~]#...
分类:
系统相关 时间:
2014-10-03 11:06:34
阅读次数:
468