Tech Unleashed

Wohoo!! We're on YouTube

Sunday, 24 September 2023

C++: Lecture 1: Pointer's in C++ : Mastering C++ Made Simple !

 Mastering Pointer's Made Simple: Your Easy Guide to C++ !


Pointer's in C++ code [C++] :


#include<iostream>

using namespace std;

void increment(int &num){
    num++;
    cout<<"Value of number inside the function: "<<num<<endl;
}

int main()
{
    int a = 5;
    int b = 7;

    increment(a);
    increment(b);

    cout<<"value of a outside function : "<<a<<endl;
    cout<<"value of b outside function : "<<b<<endl;

    int *ptr = &a;
    int *ptr2 = &b;
    int **p2p = &ptr;


    cout<<"a = "<<a<<endl;
    cout<<"b = "<<b<<endl;
    cout<<"Ptr = "<<ptr<<endl;
    cout<<"Ptr2 = "<<ptr2<<endl;
    cout<<"p2p = "<<p2p<<endl;

    cout<<"Value of address stored at ptr = "<<*ptr<<endl;
    cout<<"Value of address stored at ptr2 = "<<*ptr2<<endl;

    cout<<"Value of address stored at p2p = "<<**p2p<<endl;

    return 0;
}

Hey, thanks for watching our video about Pointers in C++ ! In this video we’ll walk you through:

- Computer Memory

- Address

- Definition of Pointer

- Syntax

- Pointer to Pointer

- Call by value

- Call by reference

- Null Pointer


All codes are available at my GitHub account, check them out here:

https://github.com/shyamkanth/Placements


Check out other videos from DS Revealed playlist: https://www.youtube.com/playlist?list=PLNXqJgOsTCZOB60T9HDhMf_o8RXbNWgqS


Check out our channel here: https://www.youtube.com/@DevelopersByte


Find us at: https://shyamkanth.github.io/


Timestamps:

0:00 Intro

0:41 Index

2:28 Computer memory

6:07 Address

9:00 Definition of pointer

12:58 Syntax

21:30 Example (Code)

25:45 Pointer to Pointer

35:15 Pointer to Pointer Code

40:50 Call by value

43:23 Call by value implementation

49:28 Call by reference

53:04 Call by reference implementation

54:50 Null Pointer

56:03 Outro


About our channel:

Our channel is about Revealing the secrets of Data Structure. We cover lots of cool stuff such as Codes, Concepts and Implementations.

Check out our channel here: https://www.youtube.com/@DevelopersByte

Don’t forget to subscribe!


Follow me on social media:

Get updates or reach out to Get updates on our Social Media Profiles!

GitHub: https://github.com/shyamkanth/

Instagram: https://instagram.com/still_23.6_8

Instagram personal: https://instagram.com/itz_sammmii

No comments:

Post a Comment