MCITMC - Tin Tức Việt Nam chính xác, cập nhật trực tiếp 24/7
  • Home
  • Bất Động Sản
  • Công Nghệ
  • Kinh Doanh
No Result
View All Result
  • Home
  • Bất Động Sản
  • Công Nghệ
  • Kinh Doanh
No Result
View All Result
MCITMC - Tin Tức Việt Nam chính xác, cập nhật trực tiếp 24/7
No Result
View All Result

How to determine or get array length (size) in C/C++

admin by admin
February 3, 2020
in Công Nghệ
27
How to determine or get array length (size) in C/C++



In this video I will show you a technique to automatically get the size of an array in C/C++ using sizeof operator without having to hard-code the value

I’m raising money to Support My Channel. Click to Donate Now:
Thank you for your support!

Nguồn:https://mcitmc.org/

Xem Thêm Bài Viết Khác:https://mcitmc.org/cong-nghe/

Tags: Youtube
Previous Post

Top 25 Ý Tưởng Trang Trí Bánh Sinh Nhật Tuyệt Vời | Ý Tưởng Làm Bánh Kem #3

Next Post

ÁO DÀI ĐẸP THANH LỊCH VỚI HOA NHÍ & HOA LAVENDER 💝 Vải Áo Dài S

Next Post
ÁO DÀI ĐẸP THANH LỊCH VỚI HOA NHÍ & HOA LAVENDER 💝 Vải Áo Dài S

ÁO DÀI ĐẸP THANH LỊCH VỚI HOA NHÍ & HOA LAVENDER 💝 Vải Áo Dài S

Comments 27

  1. G9Gaming says:
    2 years ago

    in c++ I can't put AR[ ]
    You use it on C how to use it in c++

    Reply
  2. Limitless 1 says:
    2 years ago

    That is a cool stunt 🙂

    Reply
  3. ابراهيم الراعي says:
    2 years ago

    Brilliant…👌

    Reply
  4. Thorium Guy says:
    2 years ago

    Great Video!

    Reply
  5. Danaboina shanmukeshwar says:
    2 years ago

    Great

    Reply
  6. Sushant Shakya says:
    2 years ago

    AWESOME

    Reply
  7. Ali Ahmad says:
    2 years ago

    how can we find the size of a dynamically allocated array?

    Reply
  8. play store says:
    2 years ago

    that was awesome . I got the formula that I was seeking for. thank you very much for sharing this

    Reply
  9. Jerry Lee Melton says:
    2 years ago

    Thank you so much! I come from a Java background and this was giving me so much trouble in C++.

    Reply
  10. Shekhar Gupta says:
    2 years ago

    But if I pass this array as a parameter to some function, then how to calculate its length ?

    Reply
  11. nupur choudhary says:
    2 years ago

    very good

    Reply
  12. K-Choi says:
    2 years ago

    how about when I pass the array to a function and get the sizeof inside that function, how do I handle such thing that it won't decay, assuming that the parameter only accepts the array?

    Reply
  13. DarknessGu1deMe says:
    2 years ago

    I see 2 problems with this:
    1. what if a is of length 0, won't a[0] seg fault?
    2. placing the macro in for loop conditional would make the evaluation at every iteration. (better to do it only once)

    Reply
  14. Joaquim Jesus says:
    2 years ago

    i'm sorry, but these formula works with structures too?

    Reply
  15. CPY-ed says:
    2 years ago

    Wow, straight!!! Thanks a lot bro!!!

    Reply
  16. Andrew Manuel says:
    2 years ago

    Hi, A bit confused on how your compiler is giving you 48 as sizeof(a); on my pc using the same code i am getting it straight answer e.g 10. Note: ignore my question i was actually using an unsigned char a[] instead of int a[].

    Reply
  17. AT ATA021 says:
    2 years ago

    what is meaning of
    s1=sizeof(*arr); ?

    Reply
  18. Deepa S says:
    2 years ago

    how to find sum of the array elements, if the number of array elements are given at the run time

    Reply
  19. Ronald Crabtree says:
    2 years ago

    Thank you!

    Reply
  20. Saroj Pradhan says:
    2 years ago

    Thank you! The instruction is very clear!

    Reply
  21. Just like the movies says:
    2 years ago

    Why don't you just say sizeof array divide size of element?

    Reply
  22. Alexander Kermani says:
    2 years ago

    So concise and informative. Really amazing job. I'm behind in my C++ class (because I went straight into second semester C++ class without the first semester one), and you, my friend, are going to get me through. Thank you for the vids!

    Reply
  23. fhgjfgjdghj says:
    2 years ago

    what is "stdafx.h"

    Error 1 error C1083: Cannot open include file: 'stdafx.h': No such file or directory

    Reply
  24. Mike Newman says:
    2 years ago

    Thanks for this video, just ran into this particular problem not too long ago lol started C++ a week ago, you're a life savor! SUB!!!

    Reply
  25. Dvijendra Patel says:
    2 years ago

    i want to measure 2d arry size i tryed but didn't work;
    can you tell me how to measure

    Reply
  26. Daniel Valandra says:
    2 years ago

    Mo you'er the man, not only are you a great teacher you are good at what you do; thank you!

    Reply
  27. infinitytomorrow says:
    2 years ago

    But what if I don't know how many elements are going to be in the array?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Xem Thêm

Dự án chung cư sắp mở bán tại TPHCM mới nhất 2022

Dự án chung cư sắp mở bán tại TPHCM mới nhất 2022

March 5, 2022
Chủ đầu tư Opal City View phát triển dự án theo hướng nào?

Chủ đầu tư Opal City View phát triển dự án theo hướng nào?

July 9, 2021
Bán đất phường Long Phước,Long Phước,Quận 9,Hồ Chí Minh,Việt Nam | Nhà Đất Video

Bán đất phường Long Phước,Long Phước,Quận 9,Hồ Chí Minh,Việt Nam | Nhà Đất Video

July 9, 2021
hop-dong-mua-ban-nha-dat-gom-5-ban

Hướng dẫn quy trình bán đất Long Thành Đồng Nai chi tiết nhất

July 9, 2021
dat-nen-dong-anh-dang-duoc-dong-dao-cac-nha-dau-tu-quan-tam

4 loại đất nền Đông Anh dù rẻ đến mấy cũng chớ có mua!

July 9, 2021
nhu-cau-mua-cao-nhung-luong-giao-dich-ban-dat-quan-12-thap

Nhu cầu mua cao tại sao lượng giao dịch bán đất quận 12 lại thấp?

July 9, 2021
  • Liên Hệ
  • Chính Sách Bảo Mật

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Bất Động Sản
  • Công Nghệ
  • Kinh Doanh

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.