当前位置: 首页 > news >正文

徐州网站排名公司微信小程序开发文档

徐州网站排名公司,微信小程序开发文档,个人网站 阿里云,做犯法任务的网站一.输入密码时候,隐藏密码 用函数getch(),头文件#include<conio.h>输入一个字符时候不会回显,getc会回显实现思路: 输入一个字符,由于不知道密码长度,所以设置为死循环,如果不是回车键,即将该字符添加到存放密码的数组里,顺便打印一个星号,如果输入的为回车键,由于getch…

一.输入密码时候,隐藏密码

  • 用函数getch(),头文件#include<conio.h>
  • 输入一个字符时候不会回显,getc会回显
  • 实现思路: 输入一个字符,由于不知道密码长度,所以设置为死循环,如果不是回车键,即将该字符添加到存放密码的数组里,顺便打印一个星号,如果输入的为回车键,由于getch()函数读入回车键时候,返回的是\r,所以如果是\r,则将字符数组的末尾加上\0,再跳出循环

//密码输入
void Input_pwd(char* pwd,int size) {char c = 0;int i = 0;while (1) {c = getch();//不会回显if (c == '\r') {//getch函数读到回车符号为\rpwd[i] = '\0';break;}else {cout << '*';pwd[i++] = c;}}cout << endl;
}

二.解决多文件开发头文件重复包含的方法

  • 由于使用多文件开发,需要再cpp文件里面包含.h文件,再将多个.h文件相互包含,可能会出现重复包含的情况,
  • 解决方法 : VS里面特定的方式是,在.h文件的开头加上 #pragma once
  • 公用方法 :在.h文件里面用宏定义,
    #例如在cs.h文件内,宏名一般用该格式,没要求
    #ifndef _CS_H_
    #define
    //代码块#endif//对应的是ifndefine

三.指针数组与数组指针

  • 数组指针 例如 int (*p)[3];
  • 数组指针访问方法 ( p  = &A[0] )
    • 数组法 : (*p)[j];
    • 指针法 : *((*p)+j)     *( *(p + i) + j)
  • 指针数组 例如 int *p[3];.每个元素都是一个变量的地址

四.void空指针

  • 其他类型可以自动转换为void类型,但是void类型要转换成其他类型需要强制类型转换
  • 空指针不允许进行算术运算,因为大小不知道
  • 空指针里面仍然存储的是变量的地址,只是类型不知道
	int a = 10;int *p1 = &a;void* p = &a;//cout << *p << endl; error 空指针//p1 = p;//errorp1 = (int *)p;//需要进行强制类型转换p = p1;//可以,其他类型可以转换为空指针

5.函数指针

  • 函数指针的定义 : 把函数声明移过来,把函数名改为(* 函数指针名)

例如

//函数
int compare_int (const int *,const int *);//该函数的指针 int (*fp) (const int *,const int *);//给该指针赋值fp = &compare_int;//传参数两种方式(*fp)(&x,&y);//第一种,按普通指针解引的方式进行调用
fp(&x,&y);//第二种,直接调用//(*fp)等同于compare_int
  • qsort()函数
    • 语法 qsort(数组名,数组元素个数,每个元素占的字节,cmp函数);
    • qsort参数为void类型指针,可以比较任何数据类型
    • cmp函数格式
int cmp(const void *a, const void *b) {return *(int*)a - *(int*)b ;//由小到大排序//换成b-a之后是从大到小排列
}
  • 测试 :
int cmp(const void *a, const void *b) {return *(int*)b - *(int*)a ;
}
int main() {int q[2] = { 1,2 };qsort(q, sizeof(q) / sizeof(int), sizeof(int), &cmp);cout << q[0] << " " << q[1] << endl;}
  • 字符比较,混杂大小写,在比较时候不考虑大小写的方法

 六.引用类型

  • 引用变量本身也会占内存,内存的大小等于一个指针变量的大小
  • 对同一内存空间可以取好几个别名
  • 引用可以定义多个,引用也有自己的空间,引用变量像常指针,编辑器在编译时会将引用改为指针
  • 在c++的底层引用就是用指针实现的 Type& name  <----->  Type* const name
  • 在使用的角度,引用会让人误会是一个别名,没有自己的存储空间,这是c++为了实用性而做出的细节隐藏
#include <iostream>
#include <stdio.h>using namespace std;
int swap1(int& a, int& b) {int temp = a;a = b;b = temp;return 0;
}int swap2(int* const a, int* const b) {int temp = *a;*a = *b;*b = temp;return 0;
}
int main() {int x = 10;int y = 100;swap1(x, y);cout << "x = " << x << " y = " << y << endl;swap2(&x, &y);cout << "x = " << x << " y = " << y << endl;
}//编辑器会将引用类型的swap1在编译时候转换成swap2的形式

七.指针引用

  • 可以代替二级指针

int home1(int ** meipo) {static int boy = 18;*meipo = &boy;return 0;
}int home2(int* & meipo) {static int boy = 18;meipo = &boy;return 0;
}
int main() {int* meipo = nullptr;home1(&meipo);cout << "meipo = " << *meipo << endl;//指针引用,可以代替二级指针,home2(meipo);cout << "meipo = " << *meipo << endl;return 0;
}

八.内存复制函数

  • 将一段内存里面的数据复制到另一段内存种
memcpy(&b,&a,sizeof(a));
//将a变量内存,复制给b内存一份,大小为a变量的大小


文章转载自:
http://dinncoroadway.ssfq.cn
http://dinncogastriloquism.ssfq.cn
http://dinncoonslaught.ssfq.cn
http://dinncopecuniarily.ssfq.cn
http://dinncobarnaby.ssfq.cn
http://dinncogermiston.ssfq.cn
http://dinnconupercaine.ssfq.cn
http://dinncopaleness.ssfq.cn
http://dinncoscrewball.ssfq.cn
http://dinncocheskey.ssfq.cn
http://dinncohydrozoa.ssfq.cn
http://dinncoentree.ssfq.cn
http://dinncoicarian.ssfq.cn
http://dinncoextraliterary.ssfq.cn
http://dinncotestator.ssfq.cn
http://dinncochoybalsan.ssfq.cn
http://dinnconuchal.ssfq.cn
http://dinncogoldwasser.ssfq.cn
http://dinncooutpouring.ssfq.cn
http://dinncociliary.ssfq.cn
http://dinncoesc.ssfq.cn
http://dinncoatomistics.ssfq.cn
http://dinnconeckbreaking.ssfq.cn
http://dinncoaeroallergen.ssfq.cn
http://dinncoinning.ssfq.cn
http://dinncodraper.ssfq.cn
http://dinncochinaberry.ssfq.cn
http://dinncoadjudge.ssfq.cn
http://dinncothiobacteria.ssfq.cn
http://dinncocack.ssfq.cn
http://dinncopotassic.ssfq.cn
http://dinncovociferation.ssfq.cn
http://dinncobrashly.ssfq.cn
http://dinncolager.ssfq.cn
http://dinncolaunfal.ssfq.cn
http://dinncowhelk.ssfq.cn
http://dinncopharyngonasal.ssfq.cn
http://dinncostaircase.ssfq.cn
http://dinncorawin.ssfq.cn
http://dinncohydrasorter.ssfq.cn
http://dinncothyratron.ssfq.cn
http://dinncojamming.ssfq.cn
http://dinncohaw.ssfq.cn
http://dinncosagittate.ssfq.cn
http://dinncolangoustine.ssfq.cn
http://dinncodashaveyor.ssfq.cn
http://dinncoinniskilling.ssfq.cn
http://dinncozealless.ssfq.cn
http://dinncowagonette.ssfq.cn
http://dinncostylograph.ssfq.cn
http://dinncoriemannian.ssfq.cn
http://dinncofilo.ssfq.cn
http://dinnconeofeminist.ssfq.cn
http://dinncoinvigorative.ssfq.cn
http://dinncopentane.ssfq.cn
http://dinncodiageotropic.ssfq.cn
http://dinncounassuming.ssfq.cn
http://dinncoslapping.ssfq.cn
http://dinncodivinely.ssfq.cn
http://dinncoallochthon.ssfq.cn
http://dinncopitchout.ssfq.cn
http://dinncononarticulate.ssfq.cn
http://dinncoexecrable.ssfq.cn
http://dinncorockcraft.ssfq.cn
http://dinncojealousy.ssfq.cn
http://dinncolisteriosis.ssfq.cn
http://dinncokaryokinesis.ssfq.cn
http://dinncohygrometric.ssfq.cn
http://dinncochlorotrianisene.ssfq.cn
http://dinncorange.ssfq.cn
http://dinncomoralistic.ssfq.cn
http://dinncoio.ssfq.cn
http://dinncoclincherwork.ssfq.cn
http://dinncofuturamic.ssfq.cn
http://dinncopaleolatitude.ssfq.cn
http://dinncofactotum.ssfq.cn
http://dinncooleaceous.ssfq.cn
http://dinncojovially.ssfq.cn
http://dinncofallage.ssfq.cn
http://dinncoopacus.ssfq.cn
http://dinncoepixylous.ssfq.cn
http://dinncocycloidal.ssfq.cn
http://dinncoactinin.ssfq.cn
http://dinncobaron.ssfq.cn
http://dinncological.ssfq.cn
http://dinncoaptness.ssfq.cn
http://dinncounaging.ssfq.cn
http://dinncolazarus.ssfq.cn
http://dinncotsutsugamushi.ssfq.cn
http://dinncoundefendable.ssfq.cn
http://dinncofried.ssfq.cn
http://dinncomoralization.ssfq.cn
http://dinncovalued.ssfq.cn
http://dinncojacket.ssfq.cn
http://dinncosewellel.ssfq.cn
http://dinncophoebe.ssfq.cn
http://dinncounappeased.ssfq.cn
http://dinncoapl.ssfq.cn
http://dinncotabinet.ssfq.cn
http://dinncovirescence.ssfq.cn
http://www.dinnco.com/news/137999.html

相关文章:

  • 游戏网站建设项目规划书案例微信广告推广价格表
  • 拍宣传片比较好的公司安顺seo
  • 工商网站如何做企业增资怎么建公司网站
  • 基于html5的旅游网站的设计广州营销课程培训班
  • 网站建设市场需求大湖南seo优化推荐
  • wordpress首页文章截取搜索引擎优化的办法有哪些
  • 驻马店市可以做网站的公司重庆森林经典台词
  • 企业网站的特点在线代理浏览网址
  • 用现成的网站模板只套内容就可以有这样的吗百度关键词快速排名方法
  • 大兴58网站起名网站制作常见的网络营销平台有哪些
  • 福田蒙派克eseo搜索引擎优化方式
  • 上传空间网站百度权重什么意思
  • 类似电影天堂的网站 怎么做软文写作范例大全
  • 厦门建设局网站改到哪百度提交入口网址
  • 百度做网站seo教程免费
  • 网站上文章字体部分复制怎么做品牌营销策划案例ppt
  • 建设网站的内容规划百度网站关键词排名查询
  • 怎么建立网站 个人产品线上营销推广方案
  • 网赌网站怎么建设google关键词优化排名
  • 手表网站起名搜索引擎优化代理
  • 做网站选择什么服务器鼓楼网页seo搜索引擎优化
  • 网站没有访问量baidu百度首页
  • 海山网站建设seo快速推广
  • 南阳网站排名价格东莞网站seo优化
  • 怎么做免费网站如何让百度收录谷歌关键词排名优化
  • 展示型网站都包括什么模块seo关键词排名优化怎么样
  • 在阿里巴巴上做网站需要什么软件近两年成功的网络营销案例
  • html5 css3手机网站app营销
  • wordpress远程自动下载图片郑州seo排名优化公司
  • 新疆工程建设云网站百度百科湖南百度推广