C Programming Tutorial #13 Pointers in C | Explained with Example

preview_player
Показать описание
C Programming Tutorial #13 Pointers in C | Explained with Example
Welcome to the 13th lecture of c programming with data structures and algorithm. In this tutorial we will learn about Pointers in C programming language.
00:27 What is a pointer?
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before using it to store any variable address.
08:40 Pointers:
Pointers are themselves variables that store the address of a memory location
- The memory required by a pointer depends upon the size of the memory in the machine
- one byte could address a memory of 256 locations
- two bytes can address a memory of 64K locations
- four bytes can address a memory of 4G locations
- modern machines have RAM of 1GB or more…
- The task of allocating this memory is best left to the system

09:20 Declaring Pointers:
Pointer variable – precede its name with an asterisk
- Pointer type - the type of data stored at the address we will be storing in our pointer. For example,
int *p;
- p is the name of the variable
- The ‘*’ informs the compiler that we want a pointer variable
- Sets aside however many bytes is required to store an address in memory.
- The int says that we intend to use our pointer to point to an integer value

11:55 Pointers Example: C Program to illustrate pointers

Рекомендации по теме
Комментарии
Автор

10:26..
We can have floating point pointer but the address of pointer will always. Be of integer data type right?
eg- p=18.6(1000);
Float *p =(1000) address
But 4+4 bytes is created in memory location.

vidwatpatil