See complete series on pointers in C/C++ here:
See part 2 of this lesson here:
In this lesson, we have described how we can work with character arrays using pointers. Character arrays are used to store strings in C and we work with them for all kind of string manipulation. Working with string in C is tricky and requires good understanding of pointers.
Feel free to drop your comments. feedback and suggestions.
For practice problems and more, visit:
Like us on Facebook:
Follow us on twitter:
Nguồn: https://ka-nom.com/
Xem thêm bài viết khác: https://ka-nom.com/cong-nghe/
Xem thêm Bài Viết:
- Hướng dẫn tải và cài đặt Stranded Deep Full Crack 2020 – Daominhha.com
- How To download and install staruml || StarUml- How to make uml diagrams
- C String Library and String Copy Function – strcpy()
- [Lập trình C/C++] Xây dựng hàm strcpy – Sao chép chuỗi
- Best Mod For Seiko SKX007 Dive Watch – Strapcode's Original Super Three Link Bracelet
Sir if u remove print c in the main function it works fine but coming to out it prints ntg .when put print c in the main it prints same as u told without that statement ntg is printed the function is returning ntg even if I kept printf inthe function
Thanks 😘
😍😍😍
My takeaways:
1. How to store strings 0:59
2. Arrays and pointers are different types that are used in a similar manner 7:38
3. Arrays are always passed to function by reference 11:20
This whole channel is gold. Thanks. I'm watching this as I read the K&R C book.
14:30 works because: Since the array is passed by reference to the function, the pointer will point to the base of the array which is index 0. Then because C is passed as a char pointer, incrementing C by one will ensure traversing the array char after char since a char is 1 byte.
Sir, I have a confusion , as C2 is a pointer so , it should contain the address of C1. Now when we write C2[1] , it should give the address of first element/Character of C1. To get the value 'e' we should write *C2[1] … Please explain my mistake .
Oneth index, twoeth index, threeth index lmao 😆
Who are here via interviewBit?
Seriously helpful for me to understand this "array" thingy, thanks dude for the video
EMERGENCY ALERT!!!
say,
char c[]="Hello";
char *p;
p=&c; //Now it copies the starting address of c array to p
printf("%d",p); // gives some random address (4616543424) for first element in c which is absolutely correct
printf("%c",*p); // gives the first element 'H' in array which is also correct…
printf("%d",p[1]); //when i print like this it must give the address of second element in c but it is gives the ouput 101 which is actually the decimal representation of 'e' it is not giving the address of second element…
@3:31 it is a backward slash "" not forward slash 🙂
this may help me for passing this part
superior
at 7:10 I wrote char c[4]="john"; and it is still working??
6:11
for me , in Visal Studio Code , in 2020 , @@ , printf("Size in bytes =%lun",sizeof(C)); to work ,but not "%dn"
here in 2020
Kamal
Sir you did really great job to demonstrated all concepts in very lucid way, you are rally adept,veteran teacher who delivered such complex topics in such a way to ease way to understandable
2020 ?
In this video, The exercise solution is, the called function's argument is treated as a pointer not array, that's why we increment it.
Excellent video with the best explanation I have seen yet, thank you!! Plus leaving us homework 🙂
It‘s 2020!!
Because C is a pointer to a character. And C++ means to increment the value of C by 1 byte (the address)
you are god to me