Chinaunix首页 | 论坛 | 博客
  • 博客访问: 262234
  • 博文数量: 82
  • 博客积分: 2502
  • 博客等级: 少校
  • 技术积分: 842
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-04 15:13
文章分类

全部博文(82)

文章存档

2011年(3)

2009年(25)

2008年(54)

我的朋友

分类: C/C++

2008-11-03 00:20:01

今天参加了一次巨龙软件的笔试,哎有点打击,才知道理论的重要性,不过不管怎么样也有所收获,最近开始忙考研的事情了,blog就开始让她自己长点草了。
 

#include <iostream.h>
#include <string>
int main()
{
    int a[2][2]={{1},{2,3}};//问a[0][1]=?

    for (int i=0;i<2;i++)
    {
         for(int j=0;j<2;j++)
             cout<<a[i][j]<<endl;
    }
    char *b="abcd";
    char c[]="abcd";
    char d[10]="abcd";
    cout<<sizeof(b)<<" "<<sizeof(c)<<" "<<sizeof(d)<<endl; //问输出的这三者的空间大小

    cout<<strlen(b)<<" "<<strlen(c)<<" "<<strlen(d)<<endl;//问输出这三者的长度


    return 0;
}

阅读(578) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-11-03 08:42:26

.....