自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(52)
  • 资源 (1)
  • 收藏
  • 关注

原创 指针函数退化

void func_158301(){ char *a[] = {"a","bz","cx","d"};//指针在栈指向全局变量区 a[4] = "e";//a[1][2]->a[0+1][2]->*(a+1)[2]->*(a+1)[0+2]->*(*(a+1)+2) printf("%c\n",*(*(a+1)+1));//输入:z }

2015-08-31 14:49:12 573

原创 socket client

SocketClient[2hbr]#define _CRT_SECURE_NO_WARNINGS #include #include #include #include "itcastlog.h"typedef struct _SCK_HANDLE{ char version[64]; char ip[128]; int port; unsigned char

2015-08-19 09:07:34 614

原创 存储过程

SQL Server 存储过程---存储过程、row_number完成分页if (object_id('pro_page', 'P') is not null) drop proc proc_cursorgocreate proc pro_page @startIndex int, @endIndex intas select count(*) from

2015-08-16 20:00:20 403

原创 sprintf

#include/*某个stdio.h*/ int main()/*主函数“整数”类型*/{ char buffer[50];/*“字符”类型的数组,下面共有50个元素。*/ int n,a=5,b=3;/*三个变量都为“整数”类型,intn中间要有空格*/n=sprintf(buffer,"%d plus %d is %d",a,b,a+b);/*赋予数值*/printf("[%s

2015-08-14 10:53:00 463

原创 fprintf

fprintfint fprintf (FILE* stream, const char*format, [argument])其中,FILE*stream为文件指针,const char* format以什么样的格式输出,[argument]为输入列表#include int main(){ FILE* fp; int i = 617; c

2015-08-14 10:27:48 675

原创 __block与__weak的区别理解

NSMutableArray *mArray = [NSMutableArray arrayWithObjects:@"a",@"b",@"abc",nil]; NSMutableArray *mArrayCount = [NSMutableArray arrayWithCapacity:1]; [mArray enumerateObjectsWithOptions:NSEnume

2015-08-13 15:07:35 429

原创 修改已存在文件

#define _CRT_SECURE_NO_WARNINGS #include #include #include #define MaxLine 2048 //获取配置项int GetCfgItem(char *pFileName /*in*/, char *pKey /*in*/, char * pValue/*in out*/, int * pValueLen /*out

2015-08-11 17:11:11 337

原创 前后去空格

1.char* tmp//从begain到end遍历2.经过!isspace处赋值begain,经过isspace处赋值end3.strncpy(buff[i],begain,begain-end);#define _CRT_SECURE_NO_WARNINGS #include #include #include #define MaxLine 2048 //获取

2015-08-11 15:52:23 533

原创 KVC

#import "fileutil.h"#import "PrivacyView.h"#import "AppConstant.h"@import WebKit;@interface PrivacyView(){ NSString *website; }@property (strong, nonatomic) IBOutlet UIWebView *webView

2015-08-11 12:16:05 380

原创 exit

#define _CRT_SECURE_NO_WARNINGS #include #include #include #include "cfg_op.h"#define CFGNAME "c:/mycfg.ini"void mymenu(){ printf("=============================\n"); printf("1 测试写配置文件\n");

2015-08-11 10:32:45 357

原创 fread,fwrite

#define _CRT_SECURE_NO_WARNINGS #include #include #include //直接把内存数据 写入到 文件中typedef struct Teacher{ char name[64]; int age ;}Teacher;void main_fwrite(){ int i = 0; FILE *fp = NULL; c

2015-08-10 15:17:20 682

原创 fgets,fputs

1.函数原型char *fgets(char *buf, int bufsize, FILE *stream);参数*buf: 字符型指针,指向用来存储所得数据的地址。bufsize: 整型数据,指明存储数据的大小。*stream: 文件结构体指针,将要读取的文件流。返回值成功,则返回第一个参数buf;在读字符时遇到end-of-file,则eof指示器被设置,

2015-08-10 14:37:36 1574

原创 fgetc,feof

#define _CRT_SECURE_NO_WARNINGS#include #include #include int main(int argc, const char * argv[]) { void fgetc1(); fgetc1(); return 0;}void fgetc1(){ FILE *fp = NULL; char *

2015-08-10 13:52:58 478

原创 fputc

#define _CRT_SECURE_NO_WARNINGS#include #include #include int main(int argc, const char * argv[]) { void fputc1(); fputc1(); return 0;}#pragma - 文件操作void fputc1(){ int i; F

2015-08-10 13:40:48 509

原创 结构体偏移量

typedef struct { char id[64]; char *name;}Student3;void main(){// int i = 0; Student3 *p = NULL; Student3 t1; // & (t1.age) p = &t1; //p = p + 100; //strcpy(0,

2015-08-10 11:38:00 403

原创 结构体内存大小

#define _CRT_SECURE_NO_WARNINGS#include #include int main(int argc, const char * argv[]) { void setStudent(); setStudent(); return 0;}#pragma - Structtypedef struct {//sizeof(Stude

2015-08-10 10:41:09 380

原创 malloc(sizeof(char *)*n)模型

#define _CRT_SECURE_NO_WARNINGS #include #include #include typedef struct Teacher { //char student[10][30] char name[64]; char *alisname; char **stuname; i

2015-08-10 09:58:19 2294

原创 深拷贝和浅拷贝

1.编译器默认浅拷贝2.深拷贝需要再次分配内存#define _CRT_SECURE_NO_WARNINGS #include #include #include typedef struct Teacher{ char name[64]; int age ; char *pname2; }Teacher;//编译器的=号操作,只会把指针变量的值,从from

2015-08-08 11:54:34 317

原创 memcpy和strcpy的区别

strcpy和memcpy都是标准C库函数,它们有下面的特点。strcpy提供了字符串的复制。即strcpy只用于字符串复制,并且它不仅复制字符串内容之外,还会复制字符串的结束符。已知strcpy函数的原型是:char* strcpy(char* dest, const char* src);memcpy提供了一般内存的复制。即memcpy对于需要复制的内容没有限制,因此用途更广。

2015-08-08 11:28:22 408

原创 三种内存模型转化

1.把第一种和第二种内存模型拷贝到第三种内存模型内输出#define _CRT_SECURE_NO_WARNINGS #include #include #include int sort(char **myp1 /*in*/, int num1, char (*myp2)[30], int num2, char ***myp3, int *num3){ int i = 0

2015-08-06 17:13:05 431

原创 结构体套用二级指针

1.结构体包含二级指针#define _CRT_SECURE_NO_WARNINGS #include #include #include /*"name1111""name2222""name3333"*/typedef struct Teacher{ //char student[10][30] char name[64]; char *alisname;

2015-08-06 14:37:14 907

原创 结构体中套用一级指针

1.结构体内套用一级指针2.结构体做参数3.结构体做输出参数#define _CRT_SECURE_NO_WARNINGS #include #include #include typedef struct Teacher{ char name[64]; char *alisname; int age ; int id;}Teacher;void print

2015-08-06 11:17:02 563

原创 结构体基本操作

#define _CRT_SECURE_NO_WARNINGS #include #include #include //定义一个结构体类型//定义了一个数据类型 。固定大小内存块的别名 还没有分配内存//类型的重定义typedef struct Teacher{ char name[64]; int age ; int id;}Teacher;//用类型定义

2015-08-05 17:26:17 538

原创 指针数组的应用场景之main函数

#include "stdio.h"#include "string.h"#include "stdlib.h"#include #include //演示:指针数组的用法//演示:找错误 注意return//求关键字在表中的位置//一个入口 多个出口int searcheKeyTable(const char* table[], const int size, const

2015-08-05 16:13:59 452

原创 指针数组做函数参数的退化

#include "stdio.h"#include "string.h"#include "stdlib.h"#include #include //演示:指针数组的用法//演示:找错误 注意return//求关键字在表中的位置//一个入口 多个出口int searcheKeyTable(const char* table[], const int size, const

2015-08-05 15:57:44 424

原创 证明多维数组线性存储

#define _CRT_SECURE_NO_WARNINGS #include #include #include void printfArray01(int *array, int size){ int i = 0; for (i=0; i<size; i++) { printf("%d ", array[i]); }}void main331(){ in

2015-08-05 15:37:45 364

原创 数组指针操作一维二维数组

#pragma mark - 数组指针操作二维数组//类型是大小和地址的别名int array842(){ typedef char (*ptr)[3]; char a[3] = {"aba"}; ptr p = &a;//将整个数组a的地址赋给数组指针p //取地址 printf("[%d]:%p\n",1,&a); printf("[%d]:

2015-08-05 14:30:31 381

原创 typedef定义block实现监听者模型

#import @class loginMgr;@class AddGroupMemberRpsModel;@interface addGroupMemberMgr : NSObjecttypedef void(^AddGroupMemberObserver)(AddGroupMemberRpsModel*);@property(nonatomic,strong)loginMgr *lo

2015-08-05 11:34:05 314

原创 typedef定义数组指针操作一维数组

#define _CRT_SECURE_NO_WARNINGS #include #include #include //定义数组指针变量的方法1 //用数组类型 * void main13(){ char *Myarray[] = {"1111", "33333", "aaaa"}; //指针 数组 //数组指针 用一个指针 来指向一个数组 typedef int

2015-08-05 11:06:30 732

原创 一维数组地址和数组首元素

#define _CRT_SECURE_NO_WARNINGS #include #include #include void main11(){ int a[] = {1, 2}; int b[100] = {1, 3}; int c[200] = {0}; //编译的是 就已经确定 所有的值 为零 memset(c, 0, sizeof(c)); //显示的 重置内存

2015-08-05 09:16:45 619

原创 goto,END

#define _CRT_SECURE_NO_WARNINGS #include #include #include //有一个字符串符合以下特征(”abcdef,acccd,eeee,aaaa,e3eeeee,sssss,";)//分清楚赋值指针变量 和 操作逻辑之间的关系char ** spitString3(const char *buf1, char c, int *c

2015-08-04 17:05:57 1076

原创 字符串截取[模型三]

#define _CRT_SECURE_NO_WARNINGS #include #include #include //有一个字符串符合以下特征(”abcdef,acccd,eeee,aaaa,e3eeeee,sssss,";)//分清楚赋值指针变量 和 操作逻辑之间的关系int spitString2(const char *buf1, char c, char **myp

2015-08-04 16:13:59 286

原创 字符串截取[模型二]

使用第二种内存模型截取字符串#define _CRT_SECURE_NO_WARNINGS #include #include #include //有一个字符串符合以下特征(”abcdef,acccd,eeee,aaaa,e3eeeee,sssss,";)//分清楚赋值指针变量 和 操作逻辑之间的关系int spitString(const char *buf1, char

2015-08-04 15:52:42 323

原创 strchr

char * strchr(char * _Str, int _Ch);在参数_str中查找参数_Ch指定字符,找到返回字符_Ch在_Str中所在位置,没有找到返回NULL;#include #include int main(void){ char string[17]; char *ptr,c='r'; strcpy(string,"Thisisastri

2015-08-04 13:51:57 369

原创 排序指针交换和内存交换

#define _CRT_SECURE_NO_WARNINGS #include #include #include //void main41(){ int i = 0, j = 0; char **p2 = NULL; int num = 5; char *tmp = NULL; char tmpbuf[100]; p2 = (char **)malloc(size

2015-08-04 10:12:04 389

原创 指针操作一维数组

eg1.int myarray2(){ int array[5] = {'a','b','c','d','e'}; int *p = array; printf("[p]:%c\n",*p+4); int i = 0; for (;i<5; i++) { for (int j= i; j<5; j++) {

2015-08-03 17:37:34 733

原创 strcmp和strncmp

int strcmp(const char *s1,const char *s2);当s1当s1=s2时,返回值= 0当s1>s2时,返回正数strncmp,字符串有限比较int strncmp ( const char * str1, const char * str2, size_t num );strncmp函数是指定比较size个字符。也就是说,如果字符串s

2015-08-03 15:14:19 460

原创 链表逆序[c]

void reverse(struct list *ls)//链表逆置{ if (ls->next == NULL) return;//只有一个首节点,不需要逆置 if (ls->next->next == NULL) return;//也不需要逆置 struct list *last = ls->next;//逆置后ls->next就

2015-07-27 11:23:30 312

原创 链表的增删

#include #include struct list{ int data;//数据域 struct list *next;//指针域};struct list *create_list()//建立一个节点{ return calloc(sizeof(struct list), 1);}struct list *insert_list(struct

2015-07-24 09:48:39 494

原创 二分法查找

int bin(int *array, int low, int high, int key)//二分法查找{ while(low <= high) { int mid = (low + high) / 2; if (key == array[mid])//中间切一刀,正好和要查找的数相等 return mid;

2015-07-23 16:03:57 342

天将军录音笔使用说明[Q50]

天将军录音笔 Q50 pdf使用说明文档

2015-07-27

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除