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

Type Casts

You now know enough about dynamic memory to reserve blocks of it, but what you actually want to do is to store and retrieve data in these blocks.

The void pointer variable introduced in the previous section allows you to store and retrieve any kind of address, but it specifically does not allow you to read or write any data through it using the dereferencing operator (*) as you learned how to do in Chapter 9. The reason for this is that the void pointer variable lacks data type information. Since a void pointer can point to anything, the system cannot know if it should read or write a 1-byte char or a 4-byte integer, or something completely different.

What the system needs in such a situation is a hint from you, the programmer. You ...

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