Skip to Main Content
C Programming: Visual Quickstart Guide
book

C Programming: Visual Quickstart Guide

by Larry Ullman, Marc Liyanage
October 2004
Beginner content levelBeginner
408 pages
9h 24m
English
Peachpit Press
Content preview from C Programming: Visual Quickstart Guide

Storing and Retrieving Addresses in Pointer Variables

The previous example just used the addresses of the variables in the printf() function. Now you'll look at how to store these addresses in other variables.

As mentioned earlier, an address is really just a big number. However, you should not treat an address as a regular number and store it in an int or long variable. If you try to do this, the C compiler will complain and emit a warning message (Figure 9.4).

Figure 9.4. Addresses should not be stored in regular integer variables.

Instead of using the regular numeric variable types to hold addresses, C requires you to ...

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

Intermediate C Programming

Intermediate C Programming

Yung-Hsiang Lu
Data Structures Using C

Data Structures Using C

Samir Kumar Bandyopadhyay, Kashi Nath Dey

Publisher Resources

ISBN: 0321287630Purchase book