Creating and Using Basic Pointer in c++





This video tutorial explains the concept of pointers in c++.


You will learn what is a pointer, how to declare a pointer, how to initialise a pointer and also how to use value at operator to retrive the value pointed by the pointer  in detail with examples.

watch more about pointers at https://www.youtube.com/watch?v=yy16U56FFVk



source code for this tutorial

#include <iostream>

using namespace std;

int main()
{
int age = 24;
bool human = true;

int *ageptr;

bool *humanptr;

ageptr = &age;
humanptr = &human;

cout << age << "  --> " << ageptr <<endl;
cout << human << "  --> " << humanptr <<endl;

cout << age << "  --> " << *ageptr <<endl;
cout << human << "  --> " << *humanptr <<endl;

    return 0;
}