delphi-c

result of test 1:

1. Comment removal and file inclusion are important preprocessor tasks but type checking is a compiler task, not a C preprocessor task.

2. The #if is followed by:
    A constant expression that can involve constants, the defined operator and macro names.
3. Question: The identifier '4th_Loop' would be valid if:
--Wrong--

  • The first character was not a digit.
    Correct Answer(s):
  • None of the above.

    The answer is D. Reference 'Identifiers'. Slide 23.

    4. Question: In the following declaration what is x? int (* x())[10]
    --Correct--
    Correct Answer(s):

  • A function that returns a pointer to an array of ten integers.

    The answer is A. Reference 'Function and Function Pointer Declarations'. Slide 40.

    5. Question: What is true about declarations?
    --Correct--
    Correct Answer(s):

  • They have two parts, the declaration specifier and the declarator list.

    The answer is C. Reference 'Declarations'. Slide 28.

     

    6. Question: What is true about floating constants?
    --Correct--
    Correct Answer(s):

  • They can contain an integer part, a fraction part, an optionally signed exponent part and an optional type suffix.

     

     


     

     

     

    questions:

    1. Nevertheless the #undef directive shall not be used according to the C Coding Standards[C224]

     

    1.comments

    1.1 no nest

    1.2 in string constant, no comment 

    1.3 in charactoer literal, no comment

     

    2. macros

    2.1 macros already defined in C:

    _LINE_, _FILE_, _DATE_, _TIME_, _STDC_

     

    2.2 A macro with arguments is defiend as:

    #define name(arglist) replacement_text

    1. No space can be inserted between name and the first parenthesis

    2. apply to macro argument names in replacement text:

     

    3. #

    # stringigy operator

    ## concatenation operator

    3.1 #if is a compilation directive that is followed by a constant expression.

    the constant expression can involve only constants, macros or the defined operator.

    3.2 #elif follow the same rule as #if.

    3.3 #ifdef and #ifndef directives are followed by a macro name and test if it has been defined previously or not respectively

    3.4 all conditional compilation segments shall be terminated by an #endif directive.

     

    The line directive controls error reporting by specifying logical source file name and line numbers

    #line number "filename"

    or

    #line number

     

    The #error directive forces the compiler to generate an error message

    The #warning directive IS NOT standard but common. It works as the #error directive but generates a warning instead of an error message

    The #pragma directive provides options to the compiler and is  implementation defined.

     

    C LANGUAGE

    1. volatile:

    memory-mapped I/O,

    a pointer to a device register-- prevent the compiler from removing apparently redundant

    references through the pointer.

     

    2. int(*comp)(int e1, int e2);

    comp to be a pointer to a function that return int and take two ints as arguments.

     

    3. escape sequences

     

    4. enum

    names in different enums within the same compilation unit must be distinct but values do not

    need to be the same even in the same enum.

     

    Identifiers and keywords

    identifiers shall not rely on the significance of more than 31 characters

     

    Types and declarations

    Objects declared register have automatic storage and (if possible) stored in fast registers of the machine

    The auto and register specifiers can be used only within functions or in function prototypes.

    Const objects can be initialized but not modified afterwards

     

    The purpose of volatile is to force a compiler implementation to suppress optimizations that could otherwise occur.

    For example, for a machine with memory-mapped I/O, a pointer to a device register may be declared as a pointer to volatile in order to prevent the compiler from removing apparently redundant references through the pointer.

    int *a;

    ‘a’ is a direct-declarator, ‘*a’ is a declarator that indicates that ‘a’ is a  pointer type.

    int (*comp)(int e1, int e2);

    comp is a direct-declarator

    (*comp)is a direct-declarator

     

     

    Float* fet_level( char (*f)(int a))

    (Int (*f)(void)) Get_fet_handler(void)

     

    A big integer constant is taken as long if it does not fit in an integer one

    Also according to Delphi Standards [C68] all integer and floating constants shall be cast to the appropriate type. 

     

    A character constant is a character between single quotes as ‘B’.

    an arbitrary byte-sized bit pattern can be specified by '\ooo

     

     

     

     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Delphi11 中使用 `delphi-opencv-master` 进行图像处理和计算机视觉操作,需要使用 OpenCV 库中的一些函数和类。在 `delphi-opencv-master` 中,这些函数和类都被封装在不同的单元中,你可以通过使用 `uses` 语句来引入这些单元。 如果你想使用 `ocv.imgproc_c` 单元中的函数,可以通过以下步骤实现: 1. 在 Delphi11 中打开你的项目,然后在菜单栏中选择 `Project` -> `Options` -> `Delphi Compiler` -> `Search Path`,将 `OpenCV` 文件夹所在的路径添加到搜索路径中。 2. 在 Delphi11 中使用 `uses` 语句引入 `ocv.imgproc_c` 单元,并调用其中的函数来进行图像处理操作。 例如,以下代码演示了如何使用 `ocv.imgproc_c` 单元中的 `cvSmooth` 函数对图像进行平滑处理: ``` uses OpenCV_Core, ocv.imgproc_c, OpenCV_Image; var img: IplImage; begin // 读取图像 img := LoadImage('lena.jpg'); // 将图像转换为灰度图像 cvCvtColor(img, img, CV_RGB2GRAY); // 对图像进行平滑处理 cvSmooth(img, img, CV_GAUSSIAN, 5, 5); // 显示图像 ShowImage('My Image', img); // 等待用户按下任意键 WaitKey; // 释放图像内存 img.Release; end; ``` 这段代码使用了 `OpenCV_Core`、`ocv.imgproc_c` 和 `OpenCV_Image` 三个单元中提供的函数和类来进行图像处理和计算机视觉操作。其中,使用了 `ocv.imgproc_c` 单元中提供的 `cvSmooth` 函数对图像进行平滑处理。你可以根据自己的需要,使用 `delphi-opencv-master` 中提供的其他函数和类来进行更加复杂的图像处理和计算机视觉操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值