11 2019 档案

摘要:这俩概念还是很不一样,请君明鉴 #include<stdio.h> #include<stdlib.h> #include<time.h> void main() { //指向元素的指针和指向数组的指针 int b[10] = {1,2,3,4,5,6,7,8,10}; int *p = b;//代 阅读全文
posted @ 2019-11-29 13:11 saintdingtheGreat 阅读(797) 评论(0) 推荐(0)
摘要:通过指针遍历数组的小把戏 #include<stdio.h> #include<stdlib.h> #include<Windows.h> void main() { int a[10] = {1,2,3,4,5,6,7,8,9,10}; for (int *p = a; p <= a + 9; p 阅读全文
posted @ 2019-11-28 20:21 saintdingtheGreat 阅读(137) 评论(0) 推荐(0)
摘要:指针的运算在数组中才有意义 int *p; p++,一定是在一片连续的区域才有意义,当然越界也会带来诸多问题。 void main() { int num = 10; int *p = &num;//这根本无界可言 p++; printf("%d\n",*p); getchar(); } 输出结果: 阅读全文
posted @ 2019-11-28 15:59 saintdingtheGreat 阅读(251) 评论(0) 推荐(0)
摘要:别说我没告诉过你指针匹配类型有多重要,指针类型决定了从开始地址取多长,如何解析 void main() { int num = 100; double *p = (double*)&num;//明明是整型,我非tm按照double解析 printf("指针p指向%x,该地址上存的值为%f\n",p, 阅读全文
posted @ 2019-11-27 23:52 saintdingtheGreat 阅读(431) 评论(0) 推荐(0)
摘要:占有内存空间就有地址,有地址就可以被指针指向,如果指针作为一个参数,那么改变它就需要指针的地址,指针的指针在这种场景下就应孕而生 注意,命令double *pp = &p; 在c++中编译错误,在c中也会产生警告信息 void main() { int earning = 12000; double 阅读全文
posted @ 2019-11-27 18:10 saintdingtheGreat 阅读(493) 评论(1) 推荐(1)
摘要:二级指针实际上有两类,行指针和指针数组,这两个虽然同属于二级指针,但绝对是两个事物 阅读全文
posted @ 2019-11-27 13:33 saintdingtheGreat 阅读(236) 评论(0) 推荐(0)
摘要:指针就是一种指向内存地址的变量,利用它的一些特性我们可以完成很多工作 两个数字从小到大排序(引申的业务场景,对企业大佬的银行存款金额进行排序,这当然通过交换变量对应的数值来实现,否则盖茨大爷的钱可能全交换到我的账户下来,靠谱的做法是声明(或者说引入)指针变量,用来按照从小到大的顺序标的(指向)不同账 阅读全文
posted @ 2019-11-27 13:24 saintdingtheGreat 阅读(258) 评论(0) 推荐(0)
摘要:const分配内存的时机,编译器编译的时候分配内存 const相当于宏,用来取代c语言的#define #include<iostream> using namespace std; void main() { int a = 20; const int b = 30; const int d = 阅读全文
posted @ 2019-11-26 17:16 saintdingtheGreat 阅读(308) 评论(0) 推荐(0)
摘要:命名空间 register 在C语言横行的时代,为了加快运行速度,一些关键变量会被放入寄存器中,程序代码请求编译器把变量存入寄存器,然而C语言版的寄存器变量无法通过地址获得register变量。c++仍然支持关键字register #include "iostream" #include<strin 阅读全文
posted @ 2019-11-26 16:31 saintdingtheGreat 阅读(336) 评论(0) 推荐(0)
摘要:有人把类说成是占用固定大小内存块的别名,其定义时不占用空间 #include<iostream> #include<string> using namespace std; class mycoach { public: string name="陈培昌"; int age=22; private: 阅读全文
posted @ 2019-11-26 13:52 saintdingtheGreat 阅读(711) 评论(0) 推荐(0)
摘要:express框架初步使用 var exp = require('express'); var ejs = require('ejs'); var app = new exp(); app.set("view engine","ejs"); app.get('/index',function (re 阅读全文
posted @ 2019-11-25 00:29 saintdingtheGreat 阅读(192) 评论(0) 推荐(0)
摘要:伪对象形式 app = function () { console.log("我是一个初始化的app对象"); }; app.get=function () { console.log('这是一个app的get方法'); }; app.post = function () { console.log 阅读全文
posted @ 2019-11-22 22:02 saintdingtheGreat 阅读(312) 评论(0) 推荐(0)
摘要:一.开启一文件,这里暂且命名为aexpressclass.js 声明一个app类,用来模仿http模块中的回调函数 //var route = require('http-route'); var url = require('url'); //var app = new route(); var 阅读全文
posted @ 2019-11-17 02:36 saintdingtheGreat 阅读(382) 评论(0) 推荐(0)
摘要:怎么,觉得pecl下一个扩展包,phpize make make install php.ini里引用一下 mongodb.so就万事大吉了? Deeply Sorry!看到MongoDB\Driver\Manager not found 的提示后,估计你除了想砸电脑之外就是想拿着双筒霰弹枪 找ph 阅读全文
posted @ 2019-11-14 16:16 saintdingtheGreat 阅读(136) 评论(0) 推荐(0)
摘要:ps -ef|grep "myswooleserver.php"| grep -v "grep" | wc -l 4 cpc@cpc-Aspire-6935:~/Downloads$ ps -ef|grep "myswooleserver.php"| grep -v "grep" cpc 16849 阅读全文
posted @ 2019-11-10 15:22 saintdingtheGreat 阅读(153) 评论(0) 推荐(0)