icp/oer/courses/c-basics/sections/10-pointer/01-introduction/content.html

11 lines
796 B
HTML

<p>
Sometimes, when you are programming, you need to know, where your data is in memory. This is what pointers are used for.
They point to an <b>specific point in memory</b>, an address. You can then access the data from that pointer via the *-operator.
This is called <b>dereferencing</b>. To get the address of an value, you can use the &amp;-operator. To declare a type as an
pointer to that type just put the *-operator between the type and the name.
</p>
<p>
As a site note: If you want to print out pointer with printf, you have to use the format specifier p. The address will be printed in hexadecimal notation.
</p>
<p>For this introduction just familiarize yourself with the basics of pointers. You will be asked to use these concepts yourself in the following exercises.</p>