![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
chasein
这个作者很懒,什么都没留下…
展开
-
strlen的结束条件
#include <stdio.h>#include<string.h>int main(){ char a[1000]; int i; for(i = 0; i < 1000; ++i){ a[i] = -1 - i; } char c[] = {1,1,0,2}; char d[] = {1,1,1,'\0',2}; char e[] = ...原创 2018-09-24 10:16:03 · 1048 阅读 · 0 评论 -
比较两个字符数组和两个指针
#include<iostream>using namespace std;int main(){ char a[] = "hello"; char b[] = "hello"; char* c = "hello"; char* d = "hello"; //输出unequal if(a == b) cout<<"equal&quo原创 2018-09-21 22:18:23 · 558 阅读 · 0 评论 -
atof
简单的解析double字符串:考虑的情况:符号位 空格 异常输入(未考虑) 科学计数法(e,E)(未考虑)#include <iostream>#include <cmath>using namespace std;double atof_my(char* pStr){ //跳过空格 while(isspace(*pStr)) ++pS...原创 2018-09-22 20:13:39 · 627 阅读 · 0 评论