c/c++
zhuwenfeng215
这个作者很懒,什么都没留下…
展开
-
字符串常量与指针和数组的关系
定义指针时,编译器并不会为指针所指向的对象分配空间的,它只会为指针本身分配空间,除非在定义时就用一个字符串常量进行初始化例如char *p = "hello";常量的本质:不占据任何存储空间属于指令的一部分,编译后不再更改。此时字符串常量会生成一个指向字符的常量指针,说白了 这里的 “hello”指的是这个字符串常量的首地址,而不是这些字符本身,它是存放在静态只读区,如果试原创 2015-03-27 14:52:16 · 367 阅读 · 0 评论 -
安防运营支撑-云出警App
云出警系统是提供安保出警使用的APP,主要目的是为了改善现有出警业务主要以电话为核心进行调度的模式,通过出警APP实时进行警情的处理,主要功能:1、接收警情中心派发的警情推送2、提供客户的导航路线3、拍照上传,记录详细的出警过程4、查看历史出警完成的任务技术支持联系人:朱文峰 电话:18272164927QQ:552071613原创 2017-03-01 14:11:01 · 956 阅读 · 0 评论 -
利用c++模板实现冒泡排序
/* ArrayBubbleSort.hpp */#ifndef _ARRAY_BUBBLE_SORT_H_#define _ARRAY_BUBBLE_SORT_H_templatebool BubbleSort(T *pInput, int nLen){ int i = 0; int j = 0; bool bChange = false; T tTemp; if(!pI原创 2015-05-14 22:54:23 · 567 阅读 · 0 评论 -
利用c++模板实现选择排序
/* SelectSort.hpp */#ifndef _SELECT_SORT_H_#define _SELECT_SORT_H_templatebool SelectSort(T *pInput, int nLen){ int i = 0; int j = 0; int nMin = 0; T tTemp; if(!pInput) { return false原创 2015-05-15 08:04:00 · 628 阅读 · 0 评论 -
利用c++模板实现快速排序
/* QuickSort.hpp */#ifndef _QUICK_SORT_H_#define _QUICK_SORT_H_templatevoid QuickSort(T *pInput, int low, int high){ if(low >= high) { return; } int first = low; int last = high; int原创 2015-05-15 10:03:02 · 535 阅读 · 0 评论 -
利用c++模板实现插入排序
/* ArrayInsertSort.hpp */#ifndef _ARRAYINSERTSORT_HPP_#define _ARRAYINSERTSORT_HPP_templatebool InsertSort(T *pInput, int nLen){ int i = 0; int j = 0; T tTemp; if(!pInput) { return fal原创 2015-05-13 10:24:48 · 379 阅读 · 0 评论 -
利用c++模板实现单链表
/* SList.hpp */#ifndef _SLIST_H_#define _SLIST_H_#include using namespace std;templatestruct Node{ T m_Data; Node *m_pNext; Node() { m_pNext = NULL; }};templateclass CSList{pub原创 2015-05-13 08:39:09 · 398 阅读 · 0 评论 -
利用c++模板实现求数组最大值
#include templateint max_array(T *pInput, int nLen, T &max){ if(!pInput) { return 0; } max = pInput[0]; int i = 0; for(i = 1; i < nLen; i++) { if(max < pInput[i]) { max = pInput[i]原创 2015-05-09 22:02:50 · 2270 阅读 · 0 评论 -
c中的空指针
1.什么是空指针?空指针是指值为NULL的指针,而且这个NULL在c和c++中的定义也是不一样的#define NULL 0 /*c中定义方式*/#define NULL (void*)0 /*c++中定义方式*/如果对一个空指针赋值,程序运行时将会产生段错误,例如:#include int main(){ int *p = NULL; *p = 1;原创 2015-04-12 22:47:41 · 497 阅读 · 0 评论 -
c语言中switch语句容易引发的错误
首先来看下面一段代码#include int main(int argc, char **argv){ int i = 5; switch(i) { case 1: i++; break; case 2: i+=2; break; case 3: i+=3; break; defauit:i+=4; } printf("%d", i); return 0;}原创 2015-03-29 15:41:22 · 2555 阅读 · 0 评论 -
关于c语言的算术转换引起的bug
当执行算术运算时,如果操作数的类型不同,那么类型会发生改变,数据的类型会朝着精度更高,长度更长的方向改变,例如如果其中一个操作数是double,那么另一个也会转换成double,如果一个是usigned,那么另一个也会转换成unsigned/* * test.c * * Created on: 2015年3月24日 * Author: wind */#include原创 2015-03-27 10:41:30 · 324 阅读 · 0 评论 -
安安日志app-技术支持
安安日志是一款为企业员工定制的手机app【功能介绍】 员工每日提交当天工作情况,每周提交工作周记 可以查看七天内工作日志并修改技术支持联系人:朱文峰 电话:18272164927QQ:552071613邮箱:18272164927@163.com原创 2017-04-18 14:45:15 · 556 阅读 · 0 评论