验证demo
// chenwenjun.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <list>
//.........结构体指针的使用 和 list缓存指针
//struct Test
//{
// int len;
// char* point;
//};
//
//class A
//{
//public:
// A(){}
// ~A(){}
//
// void push();
// void pop();
//private:
// std::list<Test*> test_list_;
//};
//
//
//void A::push()
//{
// Test* test = new Test;
// test->len = 1995;
// test->point = new char[1995];
// test_list_.push_back(test);
//}
//
//void A::pop()
//{
// Test* test = test_list_.front();
// std::cout << test->len << std::endl;
//}
//
//int main()
//{
// A a;
// a.push();
// a.pop();
//
// system("pause");
//}
//...........二级指针申请内存,相当于二维数组
//struct A
//{
// int a;
//};
//
//int main()
//{
// A* a = new A[100];
// a[2].a = 100;
// //a[101].a = 101;
//
// A** aa = (A**) new int[100];
// for (int i = 0; i< 100; i++)
// {
// aa[i] = new A();
// }
// //aa[99][998].a = 1;
// aa[0][2000].a = 1;
//
//
// std::cout << a[2].a << std::endl;
// std::cout << aa[0][2000].a << std::endl;
// system("pause");
//}
//...................若想改变指针的地址需要传 二级指针 或者 一级指针的引用
// void test(char *p)
//
// {
//
// printf("[test1][p]:%p.\n", p);
//
// printf("[test2][p]:%s.\n", p);
//
// p = (char *)malloc(10);
//
// strcpy(p, "ABCDE");
//
// printf("[test3]malloc之后.....\n");
//
// printf("[test4][p]:%p.\n", p);
//
// printf("[test5][p]:%s.\n", p);
//
// free(p);
//
// }
//
//
//
// int main()
//
// {
//
// char b[6] = "abcde";
//
// char *a = b;
//
// printf("[main1][a]:%p.\n", a);
//
// printf("[main2][a]:%s.\n", a);
//
// test(a);
//
// printf("[main3][a]:%p.\n", a);
//
// printf("[main4][a]:%s.\n", a);
//
//
// system("pause");
// return 0;
//
// }
//......对象无法访问私有析构函数, list内是指针时,需要对迭代器取*
// struct S
// {
// int a;
// };
//
//
// class A
// {
// public:
// A() {
//
// }
// private:
// ~A()
// {
// std::cout << "ok...!\n";
// }
//
// };
//
// int main()
// {
// std::list<S*> s_list_;
// S s;
// s_list_.push_back(&s);
//
// for (std::list<S*>::iterator iter; iter != s_list_.end(); iter++)
// {
// S* s = *iter;
// std::cout << s->a << std::endl;
// std::cout << (*iter)->a << std::endl;
// }
//
//
//
// return 0;
// }
//..........int型强赋值给char型后会发生什么
// int main()
// {
// char a[10];
// a[0] = 2;
// //printf("%d\n", a[0]);
//
// if (2 == a[0])
// {
// std::cout << (int)a[0] << std::endl;
// printf("%d\n", a[0]);
// }
// system("pause");
// }
//........... 长字节赋给短字节有可能会被截断,例如char是一个字节,int为4个字节,
// 2在内存中其实是 00000000 00000000 00000000 00000010,char只获取 00000010,因此还没被截断,
// 超过255就会被截断。std::cout会默认匹配类型打印,a实际是个数组,若只想打印a[0],需要强转int
验证demo的更多相关文章
- @valid表单验证demo
springMVC 表单验证demo 视图层使用的是jsp
- spring mvc 建立下拉框并进行验证demo
原文出处:http://howtodoinjava.com/spring/spring-mvc/spring-mvc-populate-and-validate-dropdown-example/ 该 ...
- python_appium 之使用Appium Inspector定位工具进行元素识别,编写验证demo
一.前提条件 appium环境搭建完成,模拟器Genymotion 安装完成,且已经下载成功了模拟设备 二.元素识别操作步骤及demo 1.进入appium如下菜单 2.填写Desired Capab ...
- struts2学习笔记--拦截器(Interceptor)和登录权限验证Demo
理解 Interceptor拦截器类似于我们学过的过滤器,是可以在action执行前后执行的代码.是我们做web开发是经常使用的技术,比如权限控制,日志.我们也可以把多个interceptor连在一起 ...
- Django通过中间件实现登录验证demo
前提:中间件版的登录验证需要依靠session,所以数据库中要有django_session表. from django.conf.urls import url from django.contri ...
- 文件完整性hash验证demo(python脚本)
一个简单的文件完整性hash验证脚本 #!/usr/bin/env python # -*- coding: utf- -*- import os import hashlib import json ...
- angular1 表单验证demo
这是一个angular1 验证表单的小栗子: 先看代码: <div ng-controller="myController"> <form name=" ...
- 邮箱格式验证demo
<html> <head> <script type="text/javascript"> function validate_email(fi ...
- JS表单验证-12个常用的JS表单验证
JS表单验证-12个常用的JS表单验证 最近有个项目用到了表单验证,小编在项目完结后的这段时间把常用的JS表单验证demo整理了一下,和大家一起分享~~~ 1. 长度限制 <p>1. 长度 ...
随机推荐
- sql执行内部操作期间检测到不一致性解决方案
解决方法:重启下SQL服务,把下面脚本运行即可.运行后,坏掉的数据库可能会丢失. --mydb 为坏了的数据库名--mytable 为坏了的据库表--master 这里不需要更改 use mydb ...
- CentOS 7 下安装 Nginx
安装所需环境 Nginx 是 C语言 开发,建议在 Linux 上运行,当然,也可以安装 Windows 版本,本篇则使用 CentOS 7 作为安装环境. 一. gcc 安装安装 nginx 需要先 ...
- C# 关于 DataTable 的一些使用
1.抽取其中的distinct数据 DataTable dt; DataView dv = dt.DefaultView; //ToTable()的第一个参数为是否DISTINCT DataTable ...
- html基础学习笔记1
<!DOCTYPE html> 声明为 HTML5 文档 <html> 元素是 HTML 页面的根元素 <head> 元素包含了文档的元(meta)数据,如 &l ...
- CentOS6/7快捷使用gcc5
Centos6/7自带的gcc为4.x版本,可通过devtoolset工具集安装gcc5.x版本 1. 添加yum源 1)CentOS6 [hhorak-devtoolset--rebuild-boo ...
- day-11函数的形参与实参
形参与实参 参数介绍: 函数为什么要有参数:因为内部的函数体需要外部的数据 怎么定义函数的参数:在定义函数阶段,函数名后面()中来定义函数的参数 怎么使用函数的参数:在函数体中用定义的参数名直接使用 ...
- Elasticsearch(单节点)
1 Elasticsearch搭建 1.1 通过Wget下载ElasticSearch安装包wget https://artifacts.elastic.co/downloads/elasticsea ...
- 弄懂Kafka的消息流转过程
原文地址:https://www.cnblogs.com/chanshuyi/p/quick_start_of_kafka.html 大家都知道 Kafka 是一个非常牛逼的消息队列框架,阿里的 Ro ...
- python selenium TouchAction模拟移动端触摸操作(十八)
最近做移动端H5页面的自动化测试时候,需要模拟一些上拉,下滑的操作,最初考虑使用使用selenium ActionChains来模拟操作,但是ActionChains 只是针对PC端程序鼠标模拟的一系 ...
- case when then
--使用IN的时候 SELECT keyCol, CASE WHEN keyCol IN ( SELECT keyCol FROM tbl_B ) THEN 'Matched' ELSE 'Unmat ...