std array C++
Вставка
- Опубліковано 6 вер 2024
- JOIN ME
-----
UA-cam 🎬 / @cppnuts
Patreon 🚀 / cppnuts
COMPLETE PLAYLIST
------------
C++ Tutorial For Beginners: • Introduction To C++
STL (Standard Template Library): • STL In C++
ThreadIng In C++: • Multithreading In C++
Data Structures: • Data Structure
Algorithms: • Binary Search
Design Patterns: • Factory Design Pattern...
Smart Pointers: • Smart Pointer In C++
C++14: • Digit Separator In C++
C++17: • std string_view in C++...
C++ All Type Casts: • static_cast In C++
INTERVIEW PLAYLIST
------------
C++ Interview Q&A: • Structural Padding & P...
C++ Interview Q&A For Experienced: • How delete[] Knows How...
Linked List Interview Questions: • Find Kth Node From Bac...
BST Interview Questions: • Search Element In Bina...
Array Interview Questions: • Reverse An Array
String Interview Questions: • Check String Is Palind...
Bit Manipulation Questions: • Find Set Bit In Intege...
Binary Tree Interview Question: • Invert Binary Tree
Sorting Algorithms: • Bubble Sort
C++ MCQ: • Video
C MCQ: • What printf returns af...
C Interview Questions: • Designated Initializat...
QUICK SHORT VIDEOS
-------------
C++ Short : • C++ Short Videos
C Short : • Shorts C Programming MCQ
In this video we will learn about std array and its use cases, few important points are as follows:
1. std::array is a container that encapsulates fixed size arrays.
2. array size is needed at compile time.
3. Assign by value is actually by value.
4. Access Elements:
a. at()
b. []
c. front()
d. back()
e. data() // gives access to the underlying array
#stl #cpp #programming #tutorial #computerscience #softwareengineering
No words.......
Best C++ channel.
Exceptionally great work man.
Thanks dude...
Yes I feel the same
Finally a very good series on C++ STL !! Thanks a ton for this content.
Thanks
Agree with you. A lot of videos in YT with STL, but no one, like this
If I do something like this..will it hold good?
int x=5;
std::array arr;
or i am compelled not to use variable there??
It should work with const variable.
Felt so fortunate to find your channel... crisp and straight to point videos.
Glad to know that it is helpful!!
As a student I can't thank you enough for these videos. I always disable my adblock while watching your videos.
Ohh thanks man..
Sir ek question puchna hai
Because in competitive programming we have to take input
To ham phle hi fixed size kese initialise kr sakte h in compile time and if we want to take input of all element of array then how to take
Basically how to use this std::arrray in competitive programming like I am using this now
int n;
cin>>n;
int arr[n];
for(int i=0;i>arr[i];
And I want to replace above code with std::array
So please help
Thank you!!
Bro, in competitive coding questions, constraints are given.. you can use that constraints to take the input size for std::array
Yeah, you have a new student now. I just wanna say that it is definitely clearly, your video is make for everyone.
Keep going, you need to give us more.....
thank you.
Beautiful. Thanks. I was bias at first when I heard your intro. but I'm glad i stuck around!
Happy to see that cppnuts started Stl...
Even i am happy, and thanks for all your support..
What is the output of above program?
remembered school days with “ “ as repeat in 8:15 😂
Thanks for the neat and clear explanation!
🤣
This is currently best C++ channel on UA-cam , Wonderfull
Thanks man!!
Your content is Gold. I would love to seed more videos in C++ STL playlist
Sure..
Thanks man!!
Don't know about money... But kaash bhagwan aapko.. Duniya ki saari khushi de! 🥺❤️My all the doubts were allready discussed in this video🥺❤️🔥🔥💯💯thnku sir ji🥺❤️
Thanks.. You are so sweet!!
The Best playlist on STL .
Thanks man..
Great channel👌.It deserves more subcribers
Thanks..
tysm bro... just don't stop helping !!!
Sure man!!
At 06:05 after array container pass to the function you should know the size of array again at formal parameters.so I think in both cases we should know size of array at callee/called function.
if I am not correct give example code for proving.
Hi, can you make some videos about how to use the containers, maybe in later videos or in another playlist?
Std array is a container and there are many, i may create a video on specifically on containers.
@@CppNuts ok, thanks
I loved your work, can you paste those codes too, or link to those codes in the description
Really exceptional sir. Thanks for the efforts and off course the clean code.
Thanks man..
good. very good . excellent. crystal clear. you earned a subscriber today.
Welcome aboard!
Very very helpful video....just started this playlist. Excellent work!!!
Thanks man.
why dont you use "USING NAMESPACE STD " so that you dont have to use std::
He has already using that, it's just redundant.
@@Noobmaster_x69 its considered a bad practice b/c namespace pulls all type of definitions in current scope ,eg. if another library which has its own cout function than how would compiler know which cout you want to use , its a good practice to specify ,in order to avoid confusion.
eg. std::cout //this one uses cout defined in header file std
foo::cout // this one uses cout defined in header file foo
for more info:
www.geeksforgeeks.org/using-namespace-std-considered-bad-practice/
"using namespace std;" is considered bad practice. If you're using another library or functions that share the same function name as the STD library then shit gets confusing quick.
nice explanation sir...I really appretiate u r work..
Thanks..
amazing video sir but i don't understand about .at() out of bound exception and when you used [n] function is accept when search 6th element ?
at() function gives facility that if you are going out of boundaries then it will give exception but using [] to access will not give any exceptions.
@@CppNuts [] doesn't give out of bound exception , then what does it give ??? if it is garbage value then how is it generated ???
That's undefined behaviour.
I liked the .at() function, it’s really nice and handy function
you are simply superb dude
You are
Why're you still using scope resolution operator std:: even when you have already written "using namespace std;"? I noticed it works fine even when you don't use it.
Correct, no need to write std:: if we include it.
But sometimes i forget that i already have included it.
@@CppNuts I just find it hard to read it 😂 Anyways great tutorial. Kindly keep making more videos on STL, especially implementing data structures like trees and graphs using STL. Thank you.
Sir i like your way of explaing everything very smoothly and relating with all the previous stuff.
I request you to please make videos on java also.
I will try my best
Sir, is there any difference between initializer list, and uniform initialization, other than syntax ?
Good explanation
Thanks for the quality content
Glad you enjoy it!
I can't resist myself hitting the Like button. You're OP sir 😁❤️🙏
You are!
It's something new for me! Thanks!
It was a nice video. Keep going.
Thanks!!
very informative. Nicely explained
Thanks roopesh
Having one doubt after using namespace std then also we have to include { std : : } at initialization ?
Clear explanation
Glad you think so!
Great videos.
I tried the method at 4:18, about c style array, size is determined at run time, like this:
int N;
cout > N;
int arr[N];
but I got compile error. Could you help me a little here. which is the right way to decide the size of array at run time.
ok, I found the answer by google. This is supported in C99. So whether it got compiled successfully depends on the compiler settings.
I think you are using old compiler ?
great videos.
please help me to setup visual studio code for programming in c++
Dude you will get video online its very easy.
@@CppNuts yup got it
In C as well you can't allocate an array at run time. Please correct that.
So NICE!!!! You should have more subscribers!!!
Thanks man..
Why you write std:: if in the starting you already written using namespace std????
std:: is habit and using namespace std is so that I don't have to write std::
Entire video is awesome. .but I didn't understand the third point i.e assign by value is actually by value..kinda confusing...
In normal c style array if we do assign one array to another one like aaray1 = array2; then it will just copy array2 address to array1, but in std::array if we do the same thing then it will copy element by element to array1.
Lvl of dedication
hey! when we use that using namespace std; line then also why we are writing std::..........
Correct, No need but have habit of using std.
do we really need to use std::array ? in my case array work directly...is there any difference?
God You;
Thanks dude..
Thank you!
You're welcome!
Good explanation sir,helping me out in cpp
Glad to hear that
Thanks for the content .
nice bro! best video!
You are the best!!
u r a saviour
Thanks man!!
AWESOME!!
Glad you think so!
Sir how did you learn all these concepts, which books did you followed?
I followed stack overflow.
great video! Thanks a lot !! :))
Thanks man..
awesome video
Thanks for the visit
sir,for me this video was like confusion ..like i am not crystal clear with why to use standard array instead of a normal one..i felt messed ,confused.
thanks
Welcome
Great job brother keep it up
Thank you, I will
Super👍👍
Thank you 👍
Thank You Sir😇
Welcome 😊
best video
Thanks!!
Great, thank you sir🙂
Most welcome
How to add 2 dimension array in STL?
What could the return type if i pass the modern array in the function ??
array fun(array arr1){
arr1.fill(50);
for(int i=0 ; i
Where to get details about those member functions you said?
What member function? Be more specific.
Very helpful...
Glad to hear that
Good
Thanks
The content is very good but please remove some ads. There are too many ads.
Well even in the normal array, we cannot assign the size on taking user input.
It must be pre-specified.
Other than that, all good.
Cheers!
Don't use old standard
That is old.
great stuff
Thanks!!
GOOD
Thanks
Awesome!
Thank you! Cheers!
@@CppNuts Can you pls make more videos on STL on implementation and solved examples? Please we badly need it.
@@CppNuts you didn't upload algorithms in STL sir! we badly need it sir!
Correct, i almost forgot this.
Will try to cover ASAP.
Thanks.
U can get the size with refrence bro
you can't get the size of normal array with reference also bro.
if this is what you meant.
best
Thanks
sir it would be great if you can provide source code as well
I am trying for the same.
love u bro
Thank you bro..
Can you add subtitles to this video? My English is not good so I couldn't understand some parts
voice is very
low
Sorry my bad.
Please just type into the gui, why all the handwriting? I find your handwriting confusing.
Sorry was never good in handwriting.
@@CppNuts It's just that it is easier to understand if you wrote directly in the ide :) (still VERY GOOD video!)
I got 8 ads in this 13 min video similar experience in your previous videos. I will stop watching your playlist. Thanks for everything though and try decreasing the number of ads per video!!!
If you need good content for free, please have patience.
You should not be so theoretically practically by showing result of what you say can make your video good Otherwise waste as your some video are good but after we can't relate your concept further more.. Sorry to say but you can observe by your views
You are doing well. Only one thing i don't like is when you try to speak in a different forceful accent. Please be natural.
So many people suggest the same thing, but don't you think we speak in English, then why shy using the English accent . And i have learned English from Movies, with different accents.
@@CppNuts i am not denying that we should try different accents but it sounds annoying when someone is speaking and suddenly try to change their accent which is still impure and awful. It affects the concentration of the listener.
@@rk_0059 Ok understood, it might disturb to concentrate, but when i am happy that time i do this. And i take it as fun. :D
ye unlike krne wale, BA wale h h kya 😄😄
🤣🤣
Sir where were you Are you God or something?
I am no GOD, thanks dude.
@@CppNuts Sir Can you help us out in Competitive Programming ? If you can Please Do !
Plz don't use that Fake accent
Sometime i am happy so i do that 😁
@@CppNuts its ok to do it as long as u are happy and teaching well! cheers
Thanks..
so much add too irritating
Sorry dude.
Good explanation
Thanks man!!
Plz don't use that Fake accent
Sometimes i feel like doing it, and mostly when i am very happy about something.