Skip to Main Content
Introduction to Computational Modeling Using C and Open-Source Tools
book

Introduction to Computational Modeling Using C and Open-Source Tools

by Jose M. Garrido
November 2013
Intermediate to advanced content levelIntermediate to advanced
461 pages
12h 1m
English
CRC Press
Content preview from Introduction to Computational Modeling Using C and Open-Source Tools
Pointers 127
20 return 0;
21}
The following C language statements declare an array of pointers to struct Com-
plexNum, then assign the address of structure variable var to the third element of the
pointer array cmplxPtrArray.
struct ComplexNum
*
cmplxPtrArray[150];
cmplxPtrArray[2] = &var;
An alternate syntax can be used for dereferencing a pointer to a struct. The special
characters -> after the name of the pointer variable can access any of the fields in
the struct. This is shown in the following two statements:
xr = cmplxPtr->realpart;
xi = cmplxPtr->imagpart;
One convenient feature of the C type syntax is that it avoids the circular definition
problems
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal

Publisher Resources

ISBN: 9781482216783