| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1231 人关注过本帖
标题:[求助]这几个程序谁能讲解一下……?
取消只看楼主 加入收藏
轩辕龙虾
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-6-28
收藏
 问题点数:0 回复次数:1 
[求助]这几个程序谁能讲解一下……?
#include <iostream.h>
int i;
main()
{ i=5;
{ int i;
i=7;
::i=3; cout <<”i=”<<i<<endl;
}
cout <<”i=”<<i<<endl;
}
为什么答案是i=7
i=3

#include<iostream.h>
#include<string.h>
void main()
{ char *a[5]={ “sofa”,”chair”,”bed”,”table”,”desk”},*r;
r=a[0];
for(int i=1;i<5;i++)
if(strcmp(r,a[i])>0)r=a[i];
cout<<r<<endl;
}
答案是bed……怎么来的

#include <iostream.h>
void main( )
{char str[ ]=”1234567”;
int i;
for(i=0; i<7; i+=3)
cout<< str+i<<endl;
}
这段里的str+i……怎么说的啊?


还有……这段程序能不能详细讲一下,我一点也看不懂
#include <iostream.h>
class Point
{public:
Point(int x, int y){ _x=x;y=y;}
Point(char x, char y){ _x=x;y=y;}
void Display() {cout << ”(” << _x << ”, ” << _y << ”)” << endl;}
protected:
int _x, _y;
};
void main()
{
Point a(1, 2);
Point b(‘a’,’b’);

a.Display();
b.Display();
}



暂时就这些问题…………

[此贴子已经被作者于2007-6-29 21:02:41编辑过]

搜索更多相关主题的帖子: 讲解 
2007-06-29 21:00
轩辕龙虾
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-6-28
收藏
得分:0 
…………那个程序确实一点也看不懂  总之谢谢你了的说   我先看看书
2007-06-29 21:57
快速回复:[求助]这几个程序谁能讲解一下……?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011788 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved