C++ multidimensional arrays explained ⬜

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 15

  • @BroCodez
    @BroCodez  2 года назад +13

    #include
    int main() {
    std::string cars[][3] = {{"Mustang", "Escape", "F-150"},
    {"Corvette", "Equinox", "Silverado"},
    {"Challenger", "Durango", "Ram 1500"}};
    int rows = sizeof(cars)/sizeof(cars[0]);
    int columns = sizeof(cars[0])/sizeof(cars[0][0]);
    for(int i = 0; i < rows; i++){
    for(int j = 0; j < columns; j++){
    std::cout

  • @Gamer-br1fk
    @Gamer-br1fk 25 дней назад

    For school we have to learn javascript...we had to learn 2d arrays but I needed someone to explain it in cpp first so I would get it. TYY!!!

  • @TahaProgrammer
    @TahaProgrammer Год назад +3

    Giga Chad Busted, you are nice, you are catlike

  • @neveroddnoreven1553
    @neveroddnoreven1553 8 месяцев назад

    Great stuff

  • @shahnawazmalik5291
    @shahnawazmalik5291 Год назад +1

    how do we take input from user and make them come in a matrix form

    • @shadowfall1700
      @shadowfall1700 Год назад

      look at the video he make name "How to fill an array with user input" then you gather them in a 2D array

  • @artemzakharchuk2842
    @artemzakharchuk2842 Год назад +2

    #include
    using namespace std;
    int main() {
    string peoples[] [2] = {{ "Eva", "Yula", "Lisa"},
    { "Artem" , "Kirill", " Ivan"}};
    int rows = sizeof(peoples) / sizeof(peoples[0]);
    int columns = sizeof(peoples[0]) / sizeof(peoples[0][0]);
    for ( int i = 0; i < rows; i++) {
    for (int j = 0; j < columns; j++) {
    cout

    • @retardbuster1498
      @retardbuster1498 3 месяца назад

      It should be peoples[ ][3] , not peoples[ ][2] since you have 3 elements in each row which means 3 columns

  • @user-lyf4isnt7daijobu
    @user-lyf4isnt7daijobu 3 месяца назад

    #include
    int main()
    {
    std::string students[][3] = {{"101","Amit","8.7"},
    {"102","Anuj","8.4"},
    {"103","Ankit","8.5"},
    {"104","Aditya","7.9"},
    {"105","Anu","8.9"}};
    int rows = sizeof(students)/sizeof(students[0]);
    int cols = sizeof(students[0])/sizeof(students[0][0]);
    for (int i = 0; i < rows; i++)
    {
    for (int j = 0; j < cols; j++)
    {
    std::cout

  • @randomdude5634
    @randomdude5634 5 месяцев назад

    good video man

  • @AC0_0
    @AC0_0 Год назад +1

    🥰

  • @ali.alsjad1
    @ali.alsjad1 10 месяцев назад +3

    #include
    using namespace std;
    int main()
    {
    string foods[][3] = { { "beef","lamb","pork" },// pork is haram (:
    { "tomato","potato","carrot" },
    { "aple","mango","melon" } };
    int rows = 3;
    int coloms = 3;
    for (int i = 0; i < rows; i++)
    {
    for (int j = 0; j < coloms; j++)
    {
    cout

    • @manes8008
      @manes8008 28 дней назад

      Keep it up my brother. did you make any significant progress in the last 9 months ?