打印

还有一个,有劳delphi高手了,十分感谢!!!

[复制链接]
1166|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
jimsboy|  楼主 | 2007-4-2 00:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

帮忙看一下那个inc         
inc(pQtZzMCU,Y_in_MCU*64);它到底给谁加1?还是两个都加1还是将Y_inMCU*64后再加1?
同样inc(pQtZzMCU,(Y_in_MCU+U_in_MCU)*64);也看不懂。麻烦高手帮忙解答一下,十分感谢!!!!!!!!!!!!!!!!!
 
原程序:
1:                             //红色分量
        begin
        H:=SampRate_U_H;
        VV:=SampRate_U_V;
        buf:=@U;
        pQtZzMCU:=Pint(@QtZzMCUBuffer);
                inc(pQtZzMCU,Y_in_MCU*64);
        end;
        2:                            //蓝色分量
        begin
        H:=SampRate_V_H;
        VV:=SampRate_V_V;
        buf:=@V;
        pQtZzMCU:=Pint(@QtZzMCUBuffer);
                inc(pQtZzMCU,(Y_in_MCU+U_in_MCU)*64);
        end;

相关帖子

沙发
一级菜鸟| | 2007-4-2 00:37 | 只看该作者

运行后pQtZzMCU等于pQtZzMCU加上Y_in_MCU*64的积

使用特权

评论回复
板凳
一级菜鸟| | 2007-4-2 00:38 | 只看该作者

第2个也一样

 inc(pQtZzMCU,(Y_in_MCU+U_in_MCU)*64);

先算出(Y_in_MCU+U_in_MCU)*64的值,然后pQtZzMCU加这个得数

建议你多看DELPHI的HELP

使用特权

评论回复
地板
tangzzbb| | 2007-4-28 17:21 | 只看该作者

强烈建议多看帮助!!

搞不懂楼主如何在不看帮助的条件下学习语言的??
下面摘抄了语法说明,显然,在括号内只有一个数时,该数加一,
在有两个数时,增加数为后边的数而不为一,这种用法多数用在
有指针的时候。

Delphi syntax:

procedure Inc(var X [ ; N: Longint ] );

Description

In Delphi code, Inc adds one or N to the variable X.

X is a variable of an ordinal type (including Int64), or a pointer type if the extended syntax is enabled.

N is an integer-type expression. 

X increments by 1, or by N if N is specified; that is, Inc(X) corresponds to the statement X := X + 1, and Inc(X, N) corresponds to the statement X := X + N. However, Inc generates optimized code and is especially useful in tight loops.

Note:    If X is a pointer type, it increments X by N times the size of the type pointed to. Thus, given

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

82

主题

749

帖子

11

粉丝