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

КОМЕНТАРІ • 186

  • @sudhirpratapsingh5730
    @sudhirpratapsingh5730 4 роки тому +18

    No words.......
    Best C++ channel.
    Exceptionally great work man.

  • @karthik0121
    @karthik0121 3 роки тому +9

    Finally a very good series on C++ STL !! Thanks a ton for this content.

    • @CppNuts
      @CppNuts  3 роки тому

      Thanks

    • @ignaciomora8317
      @ignaciomora8317 2 роки тому +1

      Agree with you. A lot of videos in YT with STL, but no one, like this

  • @adityaraj5200
    @adityaraj5200 3 роки тому +2

    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??

    • @CppNuts
      @CppNuts  3 роки тому

      It should work with const variable.

  • @meghnasingh9941
    @meghnasingh9941 4 роки тому +5

    Felt so fortunate to find your channel... crisp and straight to point videos.

    • @CppNuts
      @CppNuts  4 роки тому +2

      Glad to know that it is helpful!!

  • @akashpanday3583
    @akashpanday3583 3 роки тому +2

    As a student I can't thank you enough for these videos. I always disable my adblock while watching your videos.

    • @CppNuts
      @CppNuts  3 роки тому

      Ohh thanks man..

  • @arpitkumarjain4789
    @arpitkumarjain4789 4 роки тому +3

    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!!

    • @hassanimam6472
      @hassanimam6472 4 роки тому +1

      Bro, in competitive coding questions, constraints are given.. you can use that constraints to take the input size for std::array

  • @loofgodd6223
    @loofgodd6223 2 роки тому +1

    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.

  • @Diamond_Hanz
    @Diamond_Hanz 3 роки тому +1

    Beautiful. Thanks. I was bias at first when I heard your intro. but I'm glad i stuck around!

  • @christopherapps6177
    @christopherapps6177 5 років тому +8

    Happy to see that cppnuts started Stl...

    • @CppNuts
      @CppNuts  5 років тому +1

      Even i am happy, and thanks for all your support..

    • @asarellyvenu1935
      @asarellyvenu1935 4 роки тому

      What is the output of above program?

  • @krishnachaithanyaV
    @krishnachaithanyaV 4 роки тому +4

    remembered school days with “ “ as repeat in 8:15 😂
    Thanks for the neat and clear explanation!

  • @abhishekgawali165
    @abhishekgawali165 4 роки тому +1

    This is currently best C++ channel on UA-cam , Wonderfull

    • @CppNuts
      @CppNuts  4 роки тому +1

      Thanks man!!

  • @teetanrobotics5363
    @teetanrobotics5363 4 роки тому +5

    Your content is Gold. I would love to seed more videos in C++ STL playlist

    • @CppNuts
      @CppNuts  4 роки тому +1

      Sure..
      Thanks man!!

  • @JD-om6zk
    @JD-om6zk 4 роки тому +3

    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🥺❤️

    • @CppNuts
      @CppNuts  4 роки тому +1

      Thanks.. You are so sweet!!

  • @sumeshsingh8241
    @sumeshsingh8241 Рік тому

    The Best playlist on STL .

  • @stardust3579
    @stardust3579 4 роки тому +3

    Great channel👌.It deserves more subcribers

  • @anirudhdevpura2798
    @anirudhdevpura2798 4 роки тому +4

    tysm bro... just don't stop helping !!!

  • @pylavenkatesh8739
    @pylavenkatesh8739 2 роки тому

    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.

  • @emanueleoggiano
    @emanueleoggiano 5 років тому +4

    Hi, can you make some videos about how to use the containers, maybe in later videos or in another playlist?

    • @CppNuts
      @CppNuts  5 років тому +2

      Std array is a container and there are many, i may create a video on specifically on containers.

    • @emanueleoggiano
      @emanueleoggiano 5 років тому

      @@CppNuts ok, thanks

  • @nlirajkhanna1095
    @nlirajkhanna1095 3 роки тому +1

    I loved your work, can you paste those codes too, or link to those codes in the description

  • @ganeshashoklalwadewale1975
    @ganeshashoklalwadewale1975 3 роки тому +1

    Really exceptional sir. Thanks for the efforts and off course the clean code.

  • @Harsh_____13
    @Harsh_____13 4 роки тому

    good. very good . excellent. crystal clear. you earned a subscriber today.

    • @CppNuts
      @CppNuts  4 роки тому

      Welcome aboard!

  • @RADITYABCY
    @RADITYABCY 3 роки тому

    Very very helpful video....just started this playlist. Excellent work!!!

  • @vighneshk509
    @vighneshk509 4 роки тому +7

    why dont you use "USING NAMESPACE STD " so that you dont have to use std::

    • @Noobmaster_x69
      @Noobmaster_x69 4 роки тому

      He has already using that, it's just redundant.

    • @krishansingh421
      @krishansingh421 4 роки тому +9

      @@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/

    • @roshiron1816
      @roshiron1816 3 роки тому

      "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.

  • @sanjanakulkarni2451
    @sanjanakulkarni2451 2 роки тому

    nice explanation sir...I really appretiate u r work..

  • @niteshpandey8207
    @niteshpandey8207 4 роки тому +1

    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 ?

    • @CppNuts
      @CppNuts  4 роки тому +2

      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.

    • @dakshparihar3032
      @dakshparihar3032 3 роки тому

      @@CppNuts [] doesn't give out of bound exception , then what does it give ??? if it is garbage value then how is it generated ???

    • @CppNuts
      @CppNuts  3 роки тому

      That's undefined behaviour.

  • @marativamshikumar3489
    @marativamshikumar3489 3 роки тому

    I liked the .at() function, it’s really nice and handy function

  • @rudrapavankumar4607
    @rudrapavankumar4607 4 роки тому

    you are simply superb dude

  • @abhishekguptasarma2060
    @abhishekguptasarma2060 4 роки тому +2

    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.

    • @CppNuts
      @CppNuts  4 роки тому +1

      Correct, no need to write std:: if we include it.
      But sometimes i forget that i already have included it.

    • @abhishekguptasarma2060
      @abhishekguptasarma2060 4 роки тому

      @@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.

  • @adityathakur1961
    @adityathakur1961 3 роки тому

    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.

    • @CppNuts
      @CppNuts  3 роки тому

      I will try my best

  • @pallavichaudhary6636
    @pallavichaudhary6636 7 місяців тому

    Sir, is there any difference between initializer list, and uniform initialization, other than syntax ?

  • @anuragbasu1813
    @anuragbasu1813 Рік тому

    Good explanation

  • @rahulraaghava3603
    @rahulraaghava3603 3 роки тому

    Thanks for the quality content

    • @CppNuts
      @CppNuts  3 роки тому

      Glad you enjoy it!

  • @subid.majumdar
    @subid.majumdar 3 роки тому

    I can't resist myself hitting the Like button. You're OP sir 😁❤️🙏

  • @Dima-uz8gi
    @Dima-uz8gi 10 місяців тому

    It's something new for me! Thanks!

  • @kandy1249
    @kandy1249 4 роки тому +1

    It was a nice video. Keep going.

  • @nadham574
    @nadham574 16 днів тому

    very informative. Nicely explained

  • @sivaramakrishnachitithoti1428
    @sivaramakrishnachitithoti1428 3 роки тому

    Thanks roopesh

  • @dailybrunch1239
    @dailybrunch1239 3 роки тому

    Having one doubt after using namespace std then also we have to include { std : : } at initialization ?

  • @gogulaanandaa7548
    @gogulaanandaa7548 3 роки тому

    Clear explanation

    • @CppNuts
      @CppNuts  3 роки тому

      Glad you think so!

  • @huliang9001
    @huliang9001 Рік тому

    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.

    • @huliang9001
      @huliang9001 Рік тому

      ok, I found the answer by google. This is supported in C99. So whether it got compiled successfully depends on the compiler settings.

    • @CppNuts
      @CppNuts  Рік тому

      I think you are using old compiler ?

  • @mukundkedia9003
    @mukundkedia9003 4 роки тому +2

    great videos.
    please help me to setup visual studio code for programming in c++

    • @CppNuts
      @CppNuts  4 роки тому +1

      Dude you will get video online its very easy.

    • @mukundkedia9003
      @mukundkedia9003 4 роки тому

      @@CppNuts yup got it

  • @RajbirBhattacharjee
    @RajbirBhattacharjee 3 роки тому

    In C as well you can't allocate an array at run time. Please correct that.

  • @atharva1237
    @atharva1237 3 роки тому

    So NICE!!!! You should have more subscribers!!!

  • @anuragtiwari9793
    @anuragtiwari9793 3 роки тому +1

    Why you write std:: if in the starting you already written using namespace std????

    • @CppNuts
      @CppNuts  3 роки тому

      std:: is habit and using namespace std is so that I don't have to write std::

  • @vaishnavi4354
    @vaishnavi4354 3 роки тому

    Entire video is awesome. .but I didn't understand the third point i.e assign by value is actually by value..kinda confusing...

    • @CppNuts
      @CppNuts  3 роки тому

      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.

  • @shubhamshinde5643
    @shubhamshinde5643 4 роки тому

    Lvl of dedication

  • @037_shivendsingh5
    @037_shivendsingh5 2 роки тому

    hey! when we use that using namespace std; line then also why we are writing std::..........

    • @CppNuts
      @CppNuts  2 роки тому

      Correct, No need but have habit of using std.

  • @shreyasgangurde2185
    @shreyasgangurde2185 3 роки тому

    do we really need to use std::array ? in my case array work directly...is there any difference?

  • @karthickkumar1380
    @karthickkumar1380 3 роки тому

    God You;

  • @lazizaakramova8602
    @lazizaakramova8602 Рік тому

    Thank you!

  • @dhanushambrose4179
    @dhanushambrose4179 4 роки тому

    Good explanation sir,helping me out in cpp

    • @CppNuts
      @CppNuts  4 роки тому

      Glad to hear that

  • @mansidara7427
    @mansidara7427 3 роки тому

    Thanks for the content .

  • @allenyang201
    @allenyang201 4 роки тому +1

    nice bro! best video!

    • @CppNuts
      @CppNuts  4 роки тому

      You are the best!!

  • @heathledger7291
    @heathledger7291 4 роки тому

    u r a saviour

  • @harshitkumar6
    @harshitkumar6 4 роки тому +1

    AWESOME!!

    • @CppNuts
      @CppNuts  4 роки тому

      Glad you think so!

  • @sajeevyadav9
    @sajeevyadav9 3 роки тому

    Sir how did you learn all these concepts, which books did you followed?

    • @CppNuts
      @CppNuts  3 роки тому +2

      I followed stack overflow.

  • @tejustudies7881
    @tejustudies7881 2 роки тому

    great video! Thanks a lot !! :))

  • @faizanahmed9304
    @faizanahmed9304 2 роки тому

    awesome video

    • @CppNuts
      @CppNuts  2 роки тому +1

      Thanks for the visit

  • @chubbygirl1
    @chubbygirl1 4 роки тому

    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.

  • @adityapatel5541
    @adityapatel5541 2 роки тому

    thanks

  • @rajeshpalaniappan8311
    @rajeshpalaniappan8311 4 роки тому

    Great job brother keep it up

    • @CppNuts
      @CppNuts  4 роки тому

      Thank you, I will

  • @nquanta1548
    @nquanta1548 3 роки тому

    Super👍👍

    • @CppNuts
      @CppNuts  3 роки тому

      Thank you 👍

  • @ShivamGupta-qb1jo
    @ShivamGupta-qb1jo 3 роки тому

    Thank You Sir😇

  • @ayushbaranwal3177
    @ayushbaranwal3177 4 роки тому +1

    best video

  • @shivanibhatt7177
    @shivanibhatt7177 3 роки тому

    Great, thank you sir🙂

    • @CppNuts
      @CppNuts  3 роки тому +1

      Most welcome

  • @nileshwalhekar6165
    @nileshwalhekar6165 3 місяці тому

    How to add 2 dimension array in STL?

  • @swapnilkushwah8974
    @swapnilkushwah8974 4 роки тому

    What could the return type if i pass the modern array in the function ??

  • @sanjay3291
    @sanjay3291 4 роки тому

    Where to get details about those member functions you said?

    • @CppNuts
      @CppNuts  4 роки тому

      What member function? Be more specific.

  • @amchourasia
    @amchourasia 4 роки тому

    Very helpful...

    • @CppNuts
      @CppNuts  4 роки тому

      Glad to hear that

  • @ghanshyampanchal2527
    @ghanshyampanchal2527 2 роки тому

    Good

  • @zeeshanabbasi8171
    @zeeshanabbasi8171 4 роки тому

    The content is very good but please remove some ads. There are too many ads.

  • @atjhamit
    @atjhamit 3 роки тому

    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!

  • @priyanshuprasad6590
    @priyanshuprasad6590 4 роки тому

    great stuff

  • @shubhangdrolia2611
    @shubhangdrolia2611 4 роки тому

    GOOD

  • @manupareek8776
    @manupareek8776 4 роки тому

    Awesome!

    • @CppNuts
      @CppNuts  4 роки тому

      Thank you! Cheers!

    • @manupareek8776
      @manupareek8776 4 роки тому

      @@CppNuts Can you pls make more videos on STL on implementation and solved examples? Please we badly need it.

    • @manupareek8776
      @manupareek8776 4 роки тому

      @@CppNuts you didn't upload algorithms in STL sir! we badly need it sir!

    • @CppNuts
      @CppNuts  4 роки тому

      Correct, i almost forgot this.
      Will try to cover ASAP.
      Thanks.

  • @peterpaul9676
    @peterpaul9676 3 роки тому

    U can get the size with refrence bro

    • @CppNuts
      @CppNuts  3 роки тому +1

      you can't get the size of normal array with reference also bro.
      if this is what you meant.

  • @muditsingh7098
    @muditsingh7098 3 роки тому

    best

  • @nipurnbhaal481
    @nipurnbhaal481 3 роки тому

    sir it would be great if you can provide source code as well

    • @CppNuts
      @CppNuts  3 роки тому

      I am trying for the same.

  • @Virus-ke8xj
    @Virus-ke8xj 4 роки тому

    love u bro

    • @CppNuts
      @CppNuts  4 роки тому +1

      Thank you bro..

  • @HuyLX-zu5dz
    @HuyLX-zu5dz 10 місяців тому

    Can you add subtitles to this video? My English is not good so I couldn't understand some parts

  • @srinaths9624
    @srinaths9624 4 роки тому +1

    voice is very
    low

  • @roshiron1816
    @roshiron1816 3 роки тому +1

    Please just type into the gui, why all the handwriting? I find your handwriting confusing.

    • @CppNuts
      @CppNuts  3 роки тому

      Sorry was never good in handwriting.

    • @vinnievincent85
      @vinnievincent85 3 роки тому

      @@CppNuts It's just that it is easier to understand if you wrote directly in the ide :) (still VERY GOOD video!)

  • @pratikpattanaik1269
    @pratikpattanaik1269 3 роки тому +1

    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!!!

    • @CppNuts
      @CppNuts  3 роки тому +1

      If you need good content for free, please have patience.

  • @hare-Krishna.108
    @hare-Krishna.108 2 роки тому

    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

  • @rk_0059
    @rk_0059 4 роки тому

    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.

    • @CppNuts
      @CppNuts  4 роки тому +1

      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.

    • @rk_0059
      @rk_0059 4 роки тому

      @@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.

    • @CppNuts
      @CppNuts  4 роки тому +1

      @@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

  • @sahil1053
    @sahil1053 2 роки тому

    ye unlike krne wale, BA wale h h kya 😄😄

  • @sabujmaity5427
    @sabujmaity5427 4 роки тому

    Sir where were you Are you God or something?

    • @CppNuts
      @CppNuts  4 роки тому +1

      I am no GOD, thanks dude.

    • @sabujmaity5427
      @sabujmaity5427 4 роки тому +1

      @@CppNuts Sir Can you help us out in Competitive Programming ? If you can Please Do !

  • @sarthakbharadwaj5576
    @sarthakbharadwaj5576 4 роки тому +1

    Plz don't use that Fake accent

    • @CppNuts
      @CppNuts  4 роки тому +2

      Sometime i am happy so i do that 😁

    • @chiadong5699
      @chiadong5699 4 роки тому +1

      @@CppNuts its ok to do it as long as u are happy and teaching well! cheers

    • @CppNuts
      @CppNuts  4 роки тому

      Thanks..

  • @picklughosh9994
    @picklughosh9994 3 роки тому

    so much add too irritating

  • @sureshonteru4609
    @sureshonteru4609 4 роки тому +1

    Good explanation

  • @sarthakbharadwaj5576
    @sarthakbharadwaj5576 4 роки тому

    Plz don't use that Fake accent

    • @CppNuts
      @CppNuts  4 роки тому +1

      Sometimes i feel like doing it, and mostly when i am very happy about something.