31.4: Chapter 8

Embedded Controllers Using C and Arduino · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    Read aloud

    How

    Speed: 1×
    Light up
    Highlight

    Symbols: Mulberry Symbols, © 2018–2026 Steve Lee, CC BY-SA 4.0 (licence, the set), the site's own copies.

    From LibreTexts, under CC BY-NC-SA 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    31.4: Chapter 8

    Problem 1: Solution

    float *fptr;
    

    Problem 3: Solution

    c is an unsigned character, an eight bit (one byte) variable. p is a pointer to an unsigned character meaning that it contains the address of a variable which is an unsigned character (such as c). p could be two, four or eight bytes in size, depending on the operating system.

    Problem 5: Solution

    & is the “address of” operator. It returns the address of the associated variable. * is the dereferencing operator. It returns the value which is at the memory address referenced by the associated variable.

    Problem 7: Solution

    This multiplies b by the value referenced by c (i.e., c is a pointer). It may be more clear to show the pointer dereference explicitly:

    a = b * (*c);
    

    This page titled 31.4: Chapter 8 was last modified on Wed, 08 Sep 2021 02:57:24 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by James M. Fiore via source content that was edited to the style and standards of the LibreTexts platform.