Тёмный

C++ pointers explained easy 👈 

Bro Code
Подписаться 2,1 млн
Просмотров 21 тыс.
50% 1

Опубликовано:

 

17 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@BroCodez
@BroCodez 2 года назад
#include int main() { // pointers = variable that stores a memory address of another variable // sometimes it's easier to work with an address // & address-of operator // * dereference operator std::string name = "Bro"; int age = 21; std::string freePizzas[5] = {"pizza1", "pizza2", "pizza3", "pizza4", "pizza5"}; std::string *pName = &name; int *pAge = &age; std::string *pFreePizzas = freePizzas; std::cout
@tarsow7741
@tarsow7741 2 месяца назад
if its not clear to everyone, arrays are just pointers, which point to the first element in the list, for example: arr[i] is the same as *(arr + i), its also one of the reasons you can write i[arr] in C++ and it will give the same output as arr[i], there is also other things that are possible with arrays/pointers: #include int main(int argc, char *argv[]) { int size = 3; int array[size] = {10, 5, 3, 1, -2, -4, -7}; std::cout
@YoussefElAjbari
@YoussefElAjbari 2 дня назад
brain goes boom boom
@Leon-r7w
@Leon-r7w 2 месяца назад
Bro has the best videos ngel. W bro❤❤👍
@abdullahsaid-lh1hv
@abdullahsaid-lh1hv 2 месяца назад
bro you are so amazing you solved my biggest problem of pointers love U😘😘😘😘😘😘😘😘
@ZXR4GRZ
@ZXR4GRZ 16 дней назад
Thank you!❤
@shreedhoni4522
@shreedhoni4522 Год назад
If I want to locate the pizza3 in the array ,how should I use my pointer?
@game-op8up
@game-op8up Год назад
Instead of this: std::cout
@dazai826
@dazai826 3 месяца назад
@@game-op8up yeah, thats why you use int pointers not string pointers. infact myarray[index] is defined in C/C++ to be equivalent to *(myarray + index), thats why while accessing first element by using myarray[0], like in the video, is equivalent to *(myarray + 0) = *(myarray) = *myarray.
@tavares._art
@tavares._art 8 месяцев назад
int main{ std:: string = Bruh; std:: string = *pBruh = &Bruh; std::cout
@grimquokka9843
@grimquokka9843 2 месяца назад
why don't you use namespace std : (
@Pascal-1
@Pascal-1 Месяц назад
I'm watching the 6 hours c++ tutorial he made, and there he says that he doesn't like doing that
@Cinarbayramic
@Cinarbayramic Месяц назад
I think it was considered bad practice cuz other libraries might have functions with the same name
@StampleD2147AI
@StampleD2147AI Месяц назад
It's because it increases the chance for a namespace collision.
@HiboMoh
@HiboMoh 23 дня назад
He already use :: std if u use (::std) you don’t need using namespace std:
@MooseShower
@MooseShower 2 месяца назад
Thank you! It looks like I just kept forgetting the & which is why my code never worked for my homework
@wlsedlacek
@wlsedlacek Год назад
int pointer = 100; int *pPointer = &pointer
@Yousif_Maksabo
@Yousif_Maksabo 2 месяца назад
#include int main() { double temp = 44.2; double *pTemp = &temp; std::cout
@Mellows.
@Mellows. 2 месяца назад
why does the output to your freepizzas array and the pointer to said array differs when arrays are already pointers? i tried it myself and for me it outputs the same thing
@IslamMazen-xs3rh
@IslamMazen-xs3rh Месяц назад
free pizza is crazy
@zakmartin7567
@zakmartin7567 2 года назад
yesssss. keep the updates flowing :3
@HunaBopa
@HunaBopa 11 месяцев назад
assignment: #include int main() { double gpa[] = {2.5, 3.3, 4.3, 5.0, 4.05}; double *pGPA = gpa; for (int i = 0; i < 5; i ++) { std::cout
@code-charm-linux
@code-charm-linux 3 месяца назад
#include int main() { char grades[5] = {'A', 'B', 'C', 'D', 'F'}; char *pGrades = grades; std::cout
@HunaBopa
@HunaBopa 11 месяцев назад
Bro, why don't you show yourself on your video tutorials ? I think it would be more interactive for your pupils or fans to engage learning.
@bigheaddanny3377
@bigheaddanny3377 11 месяцев назад
because he is evil
@tavares._art
@tavares._art 8 месяцев назад
hes dream
@HunaBopa
@HunaBopa 8 месяцев назад
@@bigheaddanny3377 How do you know that? Bro Code dedicates his time to create quality content for his viewers. His video tutorials are great yet he doesn't show up himself. His videos has helped me a lot. I think Bro Code is a good person.
@bigheaddanny3377
@bigheaddanny3377 8 месяцев назад
i think you should suck it dude @@HunaBopa
@cursory9031
@cursory9031 4 месяца назад
It’s better not to show his face
@heavyymetal
@heavyymetal Год назад
int main(){ string favouriteGames[5] = {"Overwatch 1", "Terraria", "Rocket League", "Minecraft", "Overwatch 2"}; string *pFavouriteGames = favouriteGames; cout
@zinebell3225
@zinebell3225 Год назад
why arrays are already addresses?
@SauravKumar-lq6hr
@SauravKumar-lq6hr 8 месяцев назад
@@zinebell3225 because the array's name itself represents the address of its first element.
@imanalien4129
@imanalien4129 День назад
@@SauravKumar-lq6hr how to access the exact game in the array list? for example Overwatch 2?
Далее
POINTERS in C++
16:59
Просмотров 1 млн
Holding Bigger And Bigger Dogs
00:18
Просмотров 22 млн
Школьник угомонил бандита!
01:00
C++ CLASSES & OBJECTS explained easy 🧍
10:54
Просмотров 17 тыс.
Master Pointers in C:  10X Your C Coding!
14:12
Просмотров 306 тыс.
STRUCTS in C++ explained 🏗️
5:01
Просмотров 12 тыс.
C++ Pointers - Finally Understand Pointers
15:56
Просмотров 212 тыс.
C++ TIC TAC TOE game for beginners ⭕
19:09
Просмотров 19 тыс.
References in C++ Explained
14:21
Просмотров 100 тыс.
Why You Shouldn't Nest Your Code
8:30
Просмотров 2,7 млн
This is Why Programming Is Hard For you
10:48
Просмотров 858 тыс.
C++ user defined functions explained 📞
7:24
Просмотров 13 тыс.
Every Programming Language Ever Explained in 15 Minutes
15:29