#23 C Pointers | C Programming For Beginners

  Рет қаралды 148,890

Programiz

Programiz

Күн бұрын

Пікірлер: 194
@programizstudios
@programizstudios 2 жыл бұрын
Finding C programming hard? We’ve got you! 🚀Get 60% off on Programiz PRO Lifetime Plan this Black Friday-pay once for skills that last forever. Don’t miss out, it’s a limited-time offer! 👉Grab your discount now: bit.ly/blkfriday-24-yt
@AbhiramDeshpande-fe1vi
@AbhiramDeshpande-fe1vi Жыл бұрын
#include int main() { // Write C code here double salary = 25000; double* ptr=&salary; printf("adress:%p ",ptr); printf(" value :%.2lf",*ptr*2); return 0; }
@anommaharjan3005
@anommaharjan3005 2 жыл бұрын
I never really understood what pointer was, but my doubts and confusions were cleared out by this video. Thank you team Programiz for the wonderful and well-explained video.
@3dohd
@3dohd Жыл бұрын
Same - For some reason seeing the memory location printed on screen made a light bulb go off for me
@tshedzanembilwi4572
@tshedzanembilwi4572 3 ай бұрын
Thank you team Programiz I understand so much now that I’m going through these tutorials
@anonymouszn4978
@anonymouszn4978 2 жыл бұрын
Answer : Option C (*p = a)
@zindycangaming9851
@zindycangaming9851 2 ай бұрын
Correcto!
@kharlopena7512
@kharlopena7512 Жыл бұрын
This is most cohesive explanation of pointers I've seen online. Thank you!
@nihatdonmzov4166
@nihatdonmzov4166 Жыл бұрын
The programming task: #include int main(){ double salary; printf("Enter the salary: "); scanf("%lf", &salary); double* var = &salary; printf("%.1lf", *var); *var = 2 * *var; printf(" The new salary is %lf", *var); }
@gamerxx6344
@gamerxx6344 Ай бұрын
it should be double* var = salary; and *var =2*var;
@yashjewdhun7689
@yashjewdhun7689 11 күн бұрын
@@gamerxx6344 no
@kaseemkhan3919
@kaseemkhan3919 2 жыл бұрын
This C programming playlist is helping me so much to learn all this concepts in very easy and adaptive manner ! Thank you programiz for this
@shuvadeepsil2513
@shuvadeepsil2513 4 ай бұрын
I was totally confused while learning pointers in C. Other KZbin videos on this topic were not easy and comprehensive enough for me to understand. After watching this video all of my doubts regarding pointers were cleared. Thank You Programiz!!! ❤
@user-nt4nm4fb3u
@user-nt4nm4fb3u 10 ай бұрын
Hats off for this wonderful explanation on the topic Pointers which I so badly wanted to know how it works. Thank you
@chinenyeumeaku9262
@chinenyeumeaku9262 Жыл бұрын
#include int main() { double salary = 25.60; double* ptr = &salary; printf("Salary is : %.2lf", *ptr); double Newsalary = *ptr * 2; printf(" New salary = %.2lf", Newsalary); return 0; }
@tibish
@tibish 5 ай бұрын
Why make a Newsalary variable? The scope is to change the initial value through the pointer.
@zeadalkssas9698
@zeadalkssas9698 Жыл бұрын
thank you so much, i was unable to understand my baugette eating teacher explaining this. THANK YOU, YOU SAVED MY LIFE.
@rainfeel_
@rainfeel_ Жыл бұрын
#include int main(void) { double salary; printf("Enter salary : "); scanf("%.2lf", &salary); double* p = &salary; *p = 35; printf("Your salary is changed to %.2lf", salary); return 0; }
@rajiv_khanal
@rajiv_khanal 3 ай бұрын
Nice explanation didi. Balla clearly bujey. Thank you
@freehug071
@freehug071 Жыл бұрын
#include int main(void) { double salary = 250.45; double* ptr = &salary; printf("the salary is %.2lf", *ptr); double newsalary = *ptr * 2; printf(" %.2lf", newsalary); return 0; }
@anuskasthapit7285
@anuskasthapit7285 2 жыл бұрын
Very informative. Best tutorial for beginners! Waiting for more videos!!👍
@sanketnimbrayan1948
@sanketnimbrayan1948 2 жыл бұрын
Hlo anuska where are you from?
@tibish
@tibish 5 ай бұрын
#include int main() { double salary = 5000.00; double* s_pointer = &salary; *s_pointer *= 2; printf("%.2f", salary); return 0; }
@yourgray303
@yourgray303 Жыл бұрын
the ans is #include int main(void) { double salary; double* pointer = &salary; scanf("%lf", pointer); //DONT* cuse scanf puts value INTO &salary(memory address of salary), but POINTER IS ALR ADDRESS OF IT printf("%lf", salary); }
@Danyal-vt8dp
@Danyal-vt8dp 10 ай бұрын
so pure mam.... A lot of Respect For u
@Aspire-ml4nr
@Aspire-ml4nr 5 ай бұрын
#include int main () { double salary = 2000; printf("Address: %p ", &salary); double* ptr = &salary; printf("Value: %.2lf ", *ptr); *ptr *= 2; printf("Salary: %.2lf ", salary); return 0; }
@armandofilho7759
@armandofilho7759 2 жыл бұрын
Is so much better thx !!!
@BigSmoke-r9w
@BigSmoke-r9w 3 ай бұрын
Great explanation! You have a new subscriber! Thank you!!
@i-n_ph
@i-n_ph 7 ай бұрын
thanks, this is helpful 😊
@shrur3527
@shrur3527 Жыл бұрын
Tq so much 🙏🙏❤️❤️ Very well explained 🙏🙏❤️❤️
@PedroLopes-k5f
@PedroLopes-k5f Жыл бұрын
#include int main (){ double salary = 1000.23; double* ptr = &salary; *ptr = salary; printf("Salary = %lf", *ptr); salary = salary * 2; printf(" Salary doubled = %lf", *ptr); return 0; }
@davidbraide6647
@davidbraide6647 2 жыл бұрын
I need to route this to memory
@countrysideshowyaigrock4689
@countrysideshowyaigrock4689 Жыл бұрын
#include int main() { double salary; double* pointer; printf("Enter your salary: "); scanf("%lf", &salary); pointer = &salary; printf("%.1lf", *pointer); *pointer = 2 * *pointer; printf(" %.1lf", *pointer); return 0; }
@bbek300
@bbek300 8 ай бұрын
#include int main() { double salary; scanf("%lf",&salary); double* ptr = &salary; printf("Salary:%.2lf ",*ptr); *ptr = *ptr * 2 ; printf("New salary:%.2lf",*ptr); return 0; }
@kisilujustus
@kisilujustus 2 жыл бұрын
You are doing a good work
@juliusjnr_
@juliusjnr_ 5 ай бұрын
Great explanation!
@jordanholmes1366
@jordanholmes1366 5 ай бұрын
#include int main(/*the answer is C*/){ double salary; printf("enter your salary: "); scanf("%lf", &salary); double* ptr = &salary; printf("%.2lf ", *ptr); *ptr *= 2; printf("your new salary is %.2lf", *ptr); }
@mohammadrezajavadi3498
@mohammadrezajavadi3498 11 ай бұрын
Excellent Explanattion
@neeteshmaharjan4429
@neeteshmaharjan4429 Жыл бұрын
#include #include int main() { double salary ; printf("enter salary: "); scanf("%lf",&salary); double* ptr= &salary; printf("your salary:%lf ",*ptr); double newsalary =*ptr*2; printf("your double salary:%lf", newsalary); return 0; }
@programizstudios
@programizstudios 2 жыл бұрын
Q. Which of the following is valid for variable a and pointer p? A. *p = &a B. p = a C. *p = a D. p = *a
@renuga.k7473
@renuga.k7473 2 жыл бұрын
D
@Portagas.D.Ace75
@Portagas.D.Ace75 2 жыл бұрын
I belive it's option D , where p is the variable and *a is the address to that variable(my guess)
@davidkecskes2573
@davidkecskes2573 2 жыл бұрын
I think C... Because we open the location, what is stored in the pointer "p" and overwrite or upload the value with the value of variable "a".
@s.karthikeyan2747
@s.karthikeyan2747 2 жыл бұрын
A is right
@hardikbindal740
@hardikbindal740 2 жыл бұрын
It's C because '*' Indicates the value of p which is equal to the value of a
@perf5656
@perf5656 Ай бұрын
really good stuff!!!
@linbz2784
@linbz2784 4 ай бұрын
its helping me a lot
@MHJ-93
@MHJ-93 Жыл бұрын
Nice and simple introductory tutorial to pointers.👍
@Ech-chatouiMohammed
@Ech-chatouiMohammed 2 ай бұрын
merci beaucoup
@shireldadon-l2t
@shireldadon-l2t 7 ай бұрын
#include int main(void) { double salary; printf("please enter salary "); scanf("%lf", &salary); double* ptr = &salary; printf("value of salary is %.2lf ", *ptr); *ptr = 2 * *ptr; printf("new salary is %.2lf", *ptr); return 0; }
@bennyhuang2014
@bennyhuang2014 7 ай бұрын
Learning this before my final rahh
@behailus-tube5024
@behailus-tube5024 7 ай бұрын
programming task #include int main() { double salary = 77.5; printf("%p ", &salary); double* ptr = &salary; printf("value: %f ", *ptr); *ptr = 155; printf(" %f", salary); return 0; }
@lawrenceanekwe9318
@lawrenceanekwe9318 2 жыл бұрын
Lovely video.
@CarolMccann-xg9zi
@CarolMccann-xg9zi 5 ай бұрын
Thank you!
@sushilgbp
@sushilgbp Жыл бұрын
thank u so much it really healful .tqs alot.
@alameensaleem4158
@alameensaleem4158 Жыл бұрын
nice video
@orochimaru1253
@orochimaru1253 2 жыл бұрын
your app is really good with that style of interface and layout 👍
@light-warrior
@light-warrior 9 ай бұрын
TASK: #include int main() { double salary; printf("Enter your monthly salary: "); scanf(" %lf", &salary); double* ptr = &salary; //assigning the adress of salary to the double pointer *ptr = salary; //assigning the value of the salary to the value stored in the pointer printf(" Your salary before change: % lf", *ptr); *ptr = 2 * salary; printf(" Your new salary after the salary increase: %lf", *ptr); return 0; } C is the correct option because *p shows us the value stored in pointer and a is also showing us the value of the variable.
@johnnytherabbit291
@johnnytherabbit291 Жыл бұрын
Very clear !! Thanks
@JeongWoonKim-i4j
@JeongWoonKim-i4j Жыл бұрын
#include int main() { double salary; double* ptr; printf("Enter the salary: "); scanf("%lf", &salary); ptr = &salary; printf("Last salary: %.2lf ", *ptr); *ptr = *ptr * 2; printf("New salary: %.2lf", *ptr); return 0;
@sandeepyadav3766
@sandeepyadav3766 2 жыл бұрын
c is right.
@mohammadrezajavadi3498
@mohammadrezajavadi3498 11 ай бұрын
Thank you
@sahibaansari4450
@sahibaansari4450 Жыл бұрын
Thanks u so much mam , your way of explanation was awesome 👌 and i just learned pointer very easily
@kalu-kelechi-kalu
@kalu-kelechi-kalu Жыл бұрын
Crystal clear
@jaysanga5981
@jaysanga5981 9 ай бұрын
Answer is only c bcz *p=&a ; means dereference of p is cant store address , p=*a its wrong and *p =a; means it store value in address of what a had so address remain same but it change value in that address
@Manikanta-wz2rl
@Manikanta-wz2rl Жыл бұрын
#include int main() { double sal; double* ptr = &sal; printf("enter the salary:"); scanf("%lf",&sal); printf("salary:%.2lf",*ptr); double sal1 = sal * 2; printf(" Double_Salary:%.2lf",sal1); return 0; }
@allthingsmoney7089
@allthingsmoney7089 2 жыл бұрын
Very helpful. Thank you.
@b7sh_b7sh
@b7sh_b7sh Жыл бұрын
amazing teacher😍😍
@NantongoLindah
@NantongoLindah Жыл бұрын
I am in need of help abt the exercise given
@prajwal_bagewadi
@prajwal_bagewadi 2 жыл бұрын
very awesome video very very enlightening ❤❤❤❤❤❤❤❤🙏
@interneter
@interneter 7 ай бұрын
Great !
@Jarawain_Kharpran
@Jarawain_Kharpran Жыл бұрын
Thnx
@Ech-chatouiMohammed
@Ech-chatouiMohammed 2 ай бұрын
c'est très utile
@zawnaing344
@zawnaing344 Жыл бұрын
thanks
@thiagaodavez5465
@thiagaodavez5465 Жыл бұрын
tankis madam
@annapopova3221
@annapopova3221 Жыл бұрын
perfect
@sushilgbp
@sushilgbp Жыл бұрын
thank u
@endeavored
@endeavored 2 жыл бұрын
/* Program to change value of a variable using pointer. Instructions: Get input value for a double variable named salary, Assign the address of salary to a double pointer. Use pointer to print value of salary, increase salary by 2 times and print new salary. */ #include int main() { double salary; printf("Enter Salary: "); scanf("%lf", &salary); double* ptr = &salary; printf("Salary = %.1lf ", *ptr); *ptr = salary * 2; printf("Salary doubled = %.1lf", *ptr); return 0; }
@more_harsh
@more_harsh 2 жыл бұрын
seems correct to me atleast
@nsfw_metaMorph21
@nsfw_metaMorph21 Жыл бұрын
Could have given salary in the last printf() as the value is already changed
@karamking6404
@karamking6404 2 жыл бұрын
thanks for your explanation but what is the best way to learn c programming?
@t3bld846
@t3bld846 Жыл бұрын
practice leetcode daily bro
@AFCOE
@AFCOE Жыл бұрын
Practice
@godswillnnachionu
@godswillnnachionu 2 жыл бұрын
Great
@ssentamualvinjacob1191
@ssentamualvinjacob1191 2 жыл бұрын
hey would really hope to see a code to calculate CGPA
@livehopeskul1157
@livehopeskul1157 2 жыл бұрын
Option C
@sejalbansal486
@sejalbansal486 Жыл бұрын
there will be no error coming by using *ptr instead of * ptr, she write %d that why the value came instead of address
@qarikhalidwaheed1643
@qarikhalidwaheed1643 Жыл бұрын
Yeah, you're correct
@daireosullivan1193
@daireosullivan1193 8 ай бұрын
#include int main() { double salary; printf("Enter your yearly salary: "); scanf("%lf", &salary); double *ptr = &salary; printf("Salary = %.2lf", *ptr); *ptr = 2 * salary; printf(" New salary = %.2lf", *ptr); return 0; }
@morex288
@morex288 Жыл бұрын
love this
@poornachandraj2417
@poornachandraj2417 2 жыл бұрын
c is option
@dankorwack8598
@dankorwack8598 2 жыл бұрын
Ur so brown
@andreiacampos7111
@andreiacampos7111 2 жыл бұрын
Your soft's cool btw
@kareemtawfik2886
@kareemtawfik2886 11 ай бұрын
double salary; double*psalary=&salary; scanf("%lf",&salary); printf("%.1lf ",*psalary); printf("%.1lf ",*psalary*2);
@V1ctorinos
@V1ctorinos 4 ай бұрын
double salary = 39.500; double* ptr; ptr = &salary; printf("The salary is %.3lf ", *ptr); salary = 50.000; printf("The new salary is %.3lf", *ptr);
@DCSDilshadAhmad
@DCSDilshadAhmad Жыл бұрын
Option (c) is correct.
@rajumalekar
@rajumalekar 2 жыл бұрын
Thank you for the app
@vishalkirthik9148
@vishalkirthik9148 Жыл бұрын
#include int main(){ float a; printf("Enter the salary"); scanf("%f",&a); float* ptr=&a; printf(" The value of salary is %f",*ptr); *ptr=*ptr*2; printf(" The value of salary is %f",*ptr); return 0; }
@bryanborigas380
@bryanborigas380 2 жыл бұрын
nice
@lzii9127
@lzii9127 2 жыл бұрын
c is the correct answer i guess
@imveryscawed
@imveryscawed 7 ай бұрын
I didn't know there is a app, that's good for mw
@deepakkushwahaji3109
@deepakkushwahaji3109 2 жыл бұрын
English में तो सब study करवाते है हिंदी में भी करवा दीजिये,, हम हिंदी मीडियम लोग भी programing करना चाहते है
@akshaybagalkotkar7833
@akshaybagalkotkar7833 2 жыл бұрын
Tumse na ho payega, tum bhais charao.
@lemichael2004
@lemichael2004 2 жыл бұрын
#include int main (){ double *pointer ,salary,newSalary ; printf ("Enter your salary: "); scanf ("%lf",&salary); pointer = &salary; printf ("Value of salary =%.2lf",*pointer); newSalary = salary*2; pointer =&newSalary; printf (" Value of new Salary =%.2lf ",*pointer); return 0; } Answer of the quiz : C because *p is value , a is value so --> value =value . Thank you so much for your free lesson
@hammadraza9018
@hammadraza9018 6 ай бұрын
I end up over stimulating myself
@vishnupriya8910
@vishnupriya8910 2 жыл бұрын
Option: c
@erl2nd
@erl2nd 2 жыл бұрын
Great instructions
@innocentibeto7733
@innocentibeto7733 Жыл бұрын
the correct option is C
@054vijayakumark4
@054vijayakumark4 2 жыл бұрын
❤️❤️❤️❤️❤️
@jaredwynnepadron3000
@jaredwynnepadron3000 Жыл бұрын
#include int main() { double salary; printf("Enter salary: "); scanf("%lf", &salary); double* ptr = &salary; printf("Your salary is: %lf", *ptr); *ptr *= 2; printf(" New salary: %lf", *ptr); return 0; }
@codeforcoder1
@codeforcoder1 10 ай бұрын
10:45 (C) *p = a
@dankorwack8598
@dankorwack8598 2 жыл бұрын
Chats up
@thaaranisivakkumar7967
@thaaranisivakkumar7967 Жыл бұрын
Option c
@abdirahmaanabdirashiid
@abdirahmaanabdirashiid 3 ай бұрын
#include #include int main () { double salary= 350.57; double* ptr=&salary; *ptr=salary*2; printf("NEW SALARY: %.2lf",salary); return 0; }
@madhusmitamahapatra5181
@madhusmitamahapatra5181 2 жыл бұрын
Option C is d right answer
@Clog17
@Clog17 6 ай бұрын
#include int main() { double salary; double* ptr; double new_salary; double* newsal; printf ("Please enter your salary: "); scanf("%lf", &salary); ptr = &salary; printf("%lf ", *ptr); newsal = &new_salary; new_salary = (salary)*2; printf("%lf", *newsal); return 0; }
@ayeshaali6462
@ayeshaali6462 Жыл бұрын
I didnt understand the dufference int* ptr and int *ptr? int age=24; int* ptr=&age; printf("%p",&age); printf(" %p",ptr); printf(" value%d",*ptr); //24 int *ptr1=&age; printf(" value1 %d",*ptr1); //24 return 0; it gives same result above for both syntax
@abdulmateenalabi6063
@abdulmateenalabi6063 Жыл бұрын
int* ptr = &age; ----- is the correct way to do it as int* is making ptr a pointer. While int *ptr = &age ------ is wrong for pointing to the address because *ptr is to access the value of a variable and not address. With what you did you assigned a value variable to an address which is wrong, but since you used a value variable you will get a value instead of an address and from your last code if you try accessing your address you will not get the address.
@ananducs5622
@ananducs5622 6 ай бұрын
@@abdulmateenalabi6063 will get address
@tibish
@tibish 5 ай бұрын
there is no difference from the compile's stand point. both will be seen in the same way. From a code clarity perspective there is a big difference. For example, if you see this line: int* ptr1, ptr2, you would tend to think that both are pointers, but you would be wrong as only ptr1 is a pointer, ptr2 is just a simple int. On the other hand if you see this line: int *ptr1, *ptr2 it is immediately clear that both ptr are pointers.
@Azizam-j3c
@Azizam-j3c Жыл бұрын
//Solution. #include int main() { double salary; printf("enter the salary: "); scanf("%lf", &salary); double* salptr = &salary; printf("the value of the salary pointer is: %0.2lf ", *salptr); *salptr*=2; printf("the new value is: %0.2lf ", *salptr); }
@formodapk
@formodapk Ай бұрын
use dark mode 😭😭😭
@NantongoLindah
@NantongoLindah Жыл бұрын
8:13 8:15 8:32
@yogithabale
@yogithabale 4 ай бұрын
opt 3
#24 C Pointers and Arrays | C Programming For Beginners
9:56
Programiz
Рет қаралды 90 М.
you will never ask about pointers again after watching this video
8:03
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 24 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
Yay😃 Let's make a Cute Handbag for me 👜 #diycrafts #shorts
00:33
LearnToon - Learn & Play
Рет қаралды 117 МЛН
#15  C Functions | C Programming for Beginners
16:57
Programiz
Рет қаралды 232 М.
#21 C Strings | C Programming For Beginners
10:13
Programiz
Рет қаралды 149 М.
Introduction to Pointers | C Programming Tutorial
24:42
Portfolio Courses
Рет қаралды 119 М.
why do void* pointers even exist?
8:17
Low Level
Рет қаралды 389 М.
#25  C Pointers and Functions | C Programming For Beginners
10:01
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 829 М.
Master Pointers in C:  10X Your C Coding!
14:12
Dave's Garage
Рет қаралды 328 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 9 М.