lang-examples/pointer-to-struct.c
void printPointerEssayInformation(struct essay *theEssay) {
    int pageCount = (*theEssay).pageCount;  /* you can dereference 'theEssay' pointer
                                               and access page count with the dot operator */

    int wordCount = theEssay->wordCount;    /* you can dereference and access the field with this
                                               shortcut... the arrow operator! */

    printf("This essay is %d pages long, and has %d words.\n", pageCount, wordCount);
}
/*
    A function that accepts a pointer to an essay struct and prints the info.

    I spread out the print function to show how we can reference fields from a pointer to a struct.
    Obviously, it removes some of the efficiency we were aiming for. However... it's just for example!
*/
A function that accepts a pointer to an essay struct and prints the info.
I spread out the print function to show how we can reference fields from a pointer to a struct.
Obviously, it removes some of the efficiency we were aiming for. However... it's just for example!
A function that accepts a pointer to an essay struct and prints the info . I spread out the print function to show how we can reference fields from a pointer to a struct . Obviously it removes some of the efficiency we were aiming for . However ... it ' s just for example!
void printPointerEssayInformation(struct essay *theEssay) {
    int pageCount = (*theEssay).pageCount;  
    int wordCount = theEssay->wordCount;    
    printf("This essay is %d pages long, and has %d words.\n", pageCount, wordCount);
}
void printPointerEssayInformation ( struct essay * theEssay ) { int pageCount = ( * theEssay ) . pageCount ; int wordCount = theEssay -> wordCount ; printf ( " \n " , pageCount , wordCount ) ; }
A function that accepts a pointer to an essay struct and prints the info.
A function that accepts a pointer to an essay struct and prints the info .
/* you can dereference 'theEssay' pointer
                                               and access page count with the dot operator */ /* you can dereference and access the field with this
                                               shortcut... the arrow operator! */