VC菜鸟问题!

darkangell 2002-04-02 05:54:43
请大侠帮我解释如下:
RECT
UNIT
sizeof
谢谢.请详细一些.
...全文
81 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
i_doit 2002-04-02
  • 打赏
  • 举报
回复
我在日文环境下不能发短信息
短信息的内容:
谢谢你详细的解答. 但我对unsigned int的概念还是有点模糊,因为书上没有讲,所以请你解答,它和INT类型有什么不同呢?可以举个例子吗?

回答:
int 类型有正负号
unsigned int 类型没有正负号之分,只有正号。
i_doit 2002-04-02
  • 打赏
  • 举报
回复
我在日文环境下不能发短信息
短信息的内容:
谢谢你详细的解答. 但我对unsigned int的概念还是有点模糊,因为书上没有讲,所以请你解答,它和INT类型有什么不同呢?可以举个例子吗?

回答:
int 类型有正负号
unsigned int 类型没有正负号之分,只有正号。
i_doit 2002-04-02
  • 打赏
  • 举报
回复
一,RECT是WINDOWS提供的一个结构,它代表了一个矩形范围,其定义如下:
typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;
表示了以(left,top)为左上角顶点,以(right,bottom)为有下脚顶点的矩形范围。

二,UINT就是unsigned int 数据类型。

三,sizeof是标准C++提供的库函数,它返回一个对象在内存中所占的字节数。
eg:int i;
sizeof(i);返回int型在内存中占的字节数4。

anjy 2002-04-02
  • 打赏
  • 举报
回复
RECT是一结构,定义如下:
typedef struct tagRECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;


prog_st 2002-04-02
  • 打赏
  • 举报
回复
RECT Structure
The RECT data structure has the following form:

typedef struct tagRECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;

The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.

Members

left

Specifies the x-coordinate of the upper-left corner of a rectangle.

top

Specifies the y-coordinate of the upper-left corner of a rectangle.

right

Specifies the x-coordinate of the lower-right corner of a rectangle.

bottom

Specifies the y-coordinate of the lower-right corner of a rectangle.

Example

//Alternate ways to intialize a RECT structure:

RECT rctA;
rctA.left = 20;
rctA.top = 30;
rctA.right = 180;
rctA.bottom = 230;

RECT rctB = {20,30,180,230};

--------------------------------
UINT Unsigned INT. 不是UNIT
--------------------------------
sizeof Operator
sizeof expression

The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type (including aggregate types). This keyword returns a value of type size_t.

The expression is either an identifier or a type-cast expression (a type specifier enclosed in parentheses).

When applied to a structure type or variable, sizeof returns the actual size, which may include padding bytes inserted for alignment. When applied to a statically dimensioned array, sizeof returns the size of the entire array. The sizeof operator cannot return the size of dynamically allocated arrays or external arrays.

For related information, see Operators.

Example

// Example of the sizeof keyword
size_t i = sizeof( int );

struct align_depends {
char c;
int i;
};
size_t size = sizeof(align_depends); // The value of size depends on
// the value set with /Zp or
// #pragma pack

int array[] = { 1, 2, 3, 4, 5 }; // sizeof( array ) is 20
// sizeof( array[0] ) is 4
size_t sizearr = // Count of items in array
sizeof( array ) / sizeof( array[0] );

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧