![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
SH_Geek
这个作者很懒,什么都没留下…
展开
-
输入一段字符串,把其全部转换成大写字母
#include #include int main() { char str[100]; int len; int i=0; printf("请输入一段字符串:"); gets(str); len=strlen(str); for(i=0;i<len;i++) { if(str[i]>='a'&&str[i]<='z') str[i]-=32;//小写转换成大写是减32原创 2013-08-18 23:43:32 · 2934 阅读 · 0 评论 -
字符串内存中存储位置
原文链接:http://blog.csdn.net/yangdelong/article/details/5447362?reload 下面两篇文章分析得比较详细. 文章来源 http://blog.csdn.net/shiwei0124/archive/2009/11/26/4877546.aspx 字符串的存储方式以及静态存储区域、栈、堆 在编程的时候偶尔会遇到一个字符串的问题,好像是这转载 2013-10-25 15:19:33 · 3188 阅读 · 0 评论 -
sizeof strlen
#include #include #include using namespace std; typedef union { char i[4]; int j[5];//4*5 short int k; }U;// union类型变量的成员共用同一块内存空间,空间大小是由占用内存空间最大的变量决定的,并且每个成员的首地址是一样的 typedef struct { U a; char b原创 2013-10-30 17:32:51 · 631 阅读 · 0 评论