Heyπ
Friday c++ exam alachu ena as I said earlier Final exam seralew beye nebr esk ahun zm yalekut selala temechegn nebr becha zare mata online alew ena exam abren enseralen enatem bezeyaw le final read eyadergachu yagebachun teteykugnalchu....
Friday c++ exam alachu ena as I said earlier Final exam seralew beye nebr esk ahun zm yalekut selala temechegn nebr becha zare mata online alew ena exam abren enseralen enatem bezeyaw le final read eyadergachu yagebachun teteykugnalchu....
π13
ordinary
alex warren
I'm currently listening to this song while I'm studying C++ concepts. My goal is to understand them well enough to help u prepare for ur final exams and explain the material clearly. If you need any help, just DM @Technerdguy.
β€βπ₯7β€2π₯1π1
Ahun examochun bedeb ayachew ena sle mn manbebe ende alebachu suggest adergalewπ
β€9
Sab
We are waiting for please hurry up
Just endet behone yeshalal just andun exam wesje explain eyaderkugn lesera ?mn yeshalal???
π3
Forwarded from Self Taught Developers (βFaithβ)
Tech Nerd
I've a feeling we're gonna make it to 8k today ππ₯ @selfmadecoder
13 more people are needed to reach 8k. Please join this channelππ
β€6π₯1
I tried my best to explain it. If it is good, tell me, and I'll post the next part.
π6
Pointer
β What is a Pointer
- A pointer is a variable that stores the memory address of another variable.
-Think of it like a library catalog card that points to the location of a book (data) rather than containing the book itself.
β Pointer Basics
Declaration & Initialization
- &x β Gets the address of
- *ptr β Accesses the value at that address (
β Visualization
| Variable (x)| Pointer (ptr) |
|------------------|-------------------|
| Value:
| Address:
β Key Pointer Operations
a) Accessing Values
b) Modifying Values
c) Pointer Arithmetic (Arrays)
β Why Use Pointers?
Efficiency: Avoid copying large data (pass addresses instead).
Dynamic Memory: Allocate memory at runtime (e.g.,
Modify Variables in Functions:
β Practice Exercise
Whatβs the output?
Answer Output:
β What is a Pointer
- A pointer is a variable that stores the memory address of another variable.
-Think of it like a library catalog card that points to the location of a book (data) rather than containing the book itself.
β Pointer Basics
Declaration & Initialization
int x = 10; // Variable
int *ptr = &x; // Pointer storing address of x
- &x β Gets the address of
x (e.g., 0x7ffd4abc). - *ptr β Accesses the value at that address (
10). β Visualization
| Variable (x)| Pointer (ptr) |
|------------------|-------------------|
| Value:
10 | Stores: 0x7ffd4abc | | Address:
0x7ffd4abc | Points to x | β Key Pointer Operations
a) Accessing Values
cout << *ptr; // Output: 10
b) Modifying Values
*ptr = 20; // Changes x to 20
c) Pointer Arithmetic (Arrays)
int arr[3] = {10, 20, 30};
int *p = arr; // Points to arr[0]
cout << *(p + 1); // Output: 20 (arr[1]) β Why Use Pointers?
Efficiency: Avoid copying large data (pass addresses instead).
Dynamic Memory: Allocate memory at runtime (e.g.,
new/delete). Modify Variables in Functions:
void increment(int *p) { (*p)++; }
increment(&x); // x increases by 1
β Practice Exercise
Whatβs the output?
int a = 5, b = 10;
int *p = &a;
*p = b;
cout << a;
Answer Output:
10 (Pointer p modifies aβs value).β€4π₯1