Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1996082
  • 博文数量: 433
  • 博客积分: 918
  • 博客等级: 准尉
  • 技术积分: 3218
  • 用 户 组: 普通用户
  • 注册时间: 2012-02-24 18:21
个人简介

你是不是暗恋我,那就给我发个消息呀,让我知道o(∩∩)o

文章分类

全部博文(433)

发布时间:2013-01-07 20:43:35

strtok()函数的第一个参数不能是char *型的,因为会段错误#include <string.h>#include <stdio.h>int main(void){char *input= "wo:you:content",out[16];char *p,*q,*con,*p1,*q1,*con1;/**/ /* strtok places a NULL terminatorin front of the token, if found */sprintf(out,"%s","sdfg:sdfk:jdg");p1 = strtok(out, ":");q1 = ......【阅读全文】

阅读(2186) | 评论(1) | 转发(0)

发布时间:2013-01-07 20:03:18

最近做实验,用到strcpy()较多,经常出现段错误很是气人,就开始怀疑那些搜到的资料有点小问题,以下是我的测试结果:char *a, *b;char m[5],n[5];char x[5][5],y[5][5];strcpy( a , b ) 出现段错误;strcpy( a , x[3] ) 出现段错误;strcpy( a , m ) 出现段错误;strcpy( x[3] , b ) 没问题;strcpy( x[3] , y[2] ) 没问题;strcpy( m , n ) 没问题;对char *赋值a=b 没问题;a=m 没问题;a=x[2] 没问题;m=a 错误;x[2]=a 错误;总结......【阅读全文】

阅读(2290) | 评论(0) | 转发(0)

发布时间:2012-11-29 17:45:49

......【阅读全文】

阅读(3336) | 评论(0) | 转发(0)

发布时间:2012-10-28 23:41:02

......【阅读全文】

阅读(1477) | 评论(0) | 转发(0)

发布时间:2012-04-17 12:50:54

<span style="font-family: ; mso-ascii-font-fa......【阅读全文】

阅读(1782) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册