| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1129 人关注过本帖
标题:里面的第2题和第4题,谁做的出来,做一下
只看楼主 加入收藏
binglei5200
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-28
收藏
 问题点数:0 回复次数:10 
里面的第2题和第4题,谁做的出来,做一下

1.有一个函数Strcpy, 描述如下,请根据说明写出该函数的定义

Char *strcpy(char *strDestination, const char *strSource);

Return Value:the function returns the destination string No return value is reserved to indicate an

Error;

Parameters:strDestination Ddstination string; strSourse Null-terminated source string

Remarks: the strcpy function copies strSource, including the terminating null character to the location specified by strDestination NO overflow checking is performed when strings are copied or appended



2下面这题什么意思啊

MapMode

MM_HIENGLISH Each logical unit is converted to 0.001 inc.Positive x is to the right; positive y is up

MM_HIMETRIC Each logical unit is converted to 0.01 millimeter. Positive x is to the right;positive y is up

MM_LOENGLISH Each logical unit is converted to 0.01 inch. Positive x is to the right; positive y is up

MM_LOMETRIC Each logical unit is converted to 0.1millimeter. Positive x is to the right; positive y is up

MM_TEXT Each logical unit is converted to 1 device pixel, Positive x is to the right; positive y is dowm

MM_TWIPS Each logical unit is converted to 1/20 of a point. (Because a point is 1/72 inch,a twip is 1/1440 inch.) Positive x is to the right; positive y is up

CSC::RECTANGLE

BOOL Rectangle(int x1,int y1,int x2,int y2);

Remarks

Draws a rectangle using the current pen ,The interior of the retangle is filled using the current brush.

PenStyle

PS_SOLID Creates a solid pen.

PS_DASH Creates a dashed pen.Valid only when the pen width is 1 or less,in device units.

PS_DOT Cretes a dotted pen. Valid only when the pen width is 1 or less, in device units.

PS_NULL Creates a null pen.

CBrush::CBrush

CBrush(COLORREF crColor);

Parameters;

crColor:Specifies the foreground color of the brush as an RGB color. If the brush is hatched, this parameter specifies the color of the hatching.;




3有一个链表,他的节点结构如下:

Struct NODE

{

Int data;

NODE*next

};

此链表是按照升序排列的,请写出向链表中插入新元素的函数,要求插入后依然有序,函数声名如下,请将函数定义补充完整。

Void insertList(NODE *head,int nInsertData);

Return Value: void

Parameters: head:链表头指针。nInsertData:将要插入的新数据




4

4请补充完整的下列程序,该段程序目的是在窗口客户区的正中位置画一个边长为3厘米的红色矩形,外匡为红色,中间用红色填充0。设窗口客户区的大小为12cm*9cm(宽*高)

Voic cview:paintRectangle()

{

cclientDC dc(this);

…….

…….

}


[此贴子已经被作者于2006-5-29 20:55:37编辑过]

搜索更多相关主题的帖子: Roman Times New 
2006-05-28 14:11
Bekky
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:354
专家分:0
注 册:2006-5-29
收藏
得分:0 

Char *strcpy(char *strDestination, const char *strSource)
{
char *head;
head = strDestination;
while(strSource)
{
int i = 0;
*(strDestination + i ) = *(strSource + i);
i = i+1;
}
return head;
}

[此贴子已经被作者于2006-5-29 13:24:44编辑过]


我的编译环境为WinXp + VC 6.0 http://blog..cn/yobo
2006-05-29 13:24
Bekky
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:354
专家分:0
注 册:2006-5-29
收藏
得分:0 
第二题的意思是:
MM_HIENGLISH 每个逻辑单位转化为0.001英寸,x的正方向为右,y的正方向为上;
我的理解是:如果x想右移动一个单位,实际就是移动0.001英寸,y也是一样的意思。
其他的意思类推!!

CSC::RECTANGLE
是一个画矩形框的函数。
BOOL Rectangle(int x1,int y1,int x2,int y2);
x1,y1,代表做上角的坐标。
x2,y2,代表右下角的坐标。

PenStyle
是创建画笔时选择的画笔样式。

CBrush::CBrush

CBrush(COLORREF crColor);
是CBrush类的构造函数,COLORREF 是一个结构体。你可以这样赋值:
COLORREF crColor = RGB(0,0,0); //黑色

[此贴子已经被作者于2006-5-29 13:40:43编辑过]


我的编译环境为WinXp + VC 6.0 http://blog..cn/yobo
2006-05-29 13:31
myajax95
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:30
帖 子:2978
专家分:0
注 册:2006-3-5
收藏
得分:0 
1.
Char *strcpy(char *strDestination, const char *strSource)
{
char *head = strDestination;
while (strDestination++ = strSource++)
;
return head;
}

http://myajax95./
2006-05-29 13:32
myajax95
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:30
帖 子:2978
专家分:0
注 册:2006-3-5
收藏
得分:0 
第二题查一查GDI的介绍都会有的。

http://myajax95./
2006-05-29 14:32
myajax95
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:30
帖 子:2978
专家分:0
注 册:2006-3-5
收藏
得分:0 
3.

Void insertList(NODE *head,int nInsertData)
{
NODE *current=head, *insert = new Node;
insert->data = nInsertData;

while (current && current->data < nInsertData
&& current->next && current->next->data < nInsertData)
current = current->next;

if (current == NULL || current->data < nInsertData)
{
insert->next = current;
current = insert;
}
else
{
insert->next = current->next;
current->next = insert;
}
}


http://myajax95./
2006-05-29 14:45
binglei5200
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-28
收藏
得分:0 

第2题和第4题,谁做出来,能给个答案吗?

2006-05-29 20:55
Bekky
Rank: 3Rank: 3
等 级:新手上路
威 望:7
帖 子:354
专家分:0
注 册:2006-5-29
收藏
得分:0 

第四题大致可以这样做,因为,我不知道厘米和逻辑值的换算,所以不知道画出来是多大。
Voic cview:paintRectangle()

{

cclientDC dc(this);
CBrush redBrush;
CBrush *OldBrush;
//我暂时用30代表3厘米,120代表12cm,80代表80cm

RECT rect;
//设置所画矩形在客户区的位置和矩形的宽,长。
rect.left = 120/2-30/2;
rect.right = 120/2+30/2;
rect.top = 80/2-30/2;
rect.buttom=80/2+30/2;
redBrush.CreateSolidBrush(RGB(255,0,0); //创建红色画刷
OldBrush=dc->SelectObject(&redBrush);//选取红色画刷
dc->FillRect(&rect);//画红色矩形

dc->SelectObject(OldBrush); //还原画刷
}

[此贴子已经被作者于2006-5-30 9:41:55编辑过]


我的编译环境为WinXp + VC 6.0 http://blog..cn/yobo
2006-05-30 09:36
binglei5200
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-28
收藏
得分:0 

非常非常感谢大大们的帮忙

2006-05-30 12:44
binglei5200
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-28
收藏
得分:0 
还差那个第2题~
2006-05-30 12:44
快速回复:里面的第2题和第4题,谁做的出来,做一下
数据加载中...
 
   



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

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