C++ Programming Tutorials – 30 – C++ Dynamic Arrays – Eric Liang

Rate this post

Learn how to create C++ Dynamic Arrays. Dynamic arrays are basically arrays that can be resized when your program is running. In the past, we learned how to create arrays, specifically static arrays. Static arrays are good if you don’t need to resize your array to fit more items into it. To create C++ Dynamic Arrays, you will need to use pointer variables, know how to create an array, and you will learn the new operator as well as the delete operator.

Next Video:
Previous Video:

Be sure to “Like”, “Comment”, “Share”, and “Subscribe”. Thanks for watching!

C++ Programming Tutorials for Beginners Code Repository

What is C++ Programming Tutorials for Beginners series?

The C++ Programming Tutorials for Beginners series is a programming series where I teach beginners in programming the C++ programming language through Visual Studio. You don’t have to have any programming experience to watch this series. You will learn most of the core programming concepts, as well as be able to create simple projects using the things I cover in this C++ tutorial series.

▶Google Plus:


The introduction music used in this video is created by Tobu and Itro.
I do not take any credits for the creation of the music content.

Music: Tobu & Itro – Sunburst [NCS Release]

Artist: Tobu & Itro


#CProgrammingTutorial #ProgrammingTutorial #ProgrammingForBeginners

Tag: dynamic array c++, C++, C++ programming, c++ programming tutorials, how to program in c++, C++ for beginners, C++ programming for beginners, eric liang, how to code in c++, C++ dynamic arrays, dynamic arrays in c++, C Dynamic Arrays, C++ Pointers, C++ new, C++ delete, C++ programming tutorials for beginners, learn to code in c++, C++ for noobs, c tutorial, c tutorial for beginners, c tutorial arrays, c and c++ tutorial for beginners, introduction to c++, visual studio, c++ tutorial

Xem thêm: https://blogthủthuậ

Nguồn: https://blogthủthuậ


  1. is defining array size necessary in dynamic arrays or can we leave it empty like A= new int[ ] in the step 4 of my code
    int n
    Cin>> n
    int *A
    A= new int[n]

  2. This is THE perfect solution for what I was looking for. Not that I'm only amazed that someone presented the EXACT problem that I had, no, but you also explained it so clearly and comprehensivly, wow….this is just amazing. Kudos!

    I will probably use different loops like while (k < count)
    { blabla} but its just a matter of style at that point.

    Thank you &subbed!

  3. I have a question if you are still here,
    Why does my code say 'the readablesize is 4bytes,but 8 bytes may be read' when I use dynamic arrays. Anyone please answer🙏🙏🙏

  4. Hello Eric. Quick Syntax error I am running into is with the for loop for inputting the values into the array. I am getting an error saying that "identifier 'k' is undefined. Being new to C++ I am not sure as to what the issue is between the code you have and the one I am adapting it to for my class use. I also think I will be tuning into more of your C++ videos due to the clarity of presentation and ease of information intake.

  5. The Real Teacher The way of your teaching skill is excellent… & Unique… I found no channel in YouTube who made ths topic clearly

  6. In the ending you took the input from the user depending upon how many arrays they want…right??Now if I want to set the size of those arrays individually…how'd I do that??

    for eg. I want 10 arrays and in the 3rd one , I want to set it's size to 5 elements only…

  7. Question, what is preventing use from making a dynamic array with out the new keyword? For example
    int x;
    cin >> x;
    int someArray[x];
    I get that the heap have advantages, as well as being able to delete, but can we not do what I just did above?


Post Comment