Комментарии:
I feel like you're mosh hamadani, am I right ??
ОтветитьThis work only on stack allocation, allocation in free memory it should be defined by user in some manner of vector stl .
ОтветитьBeautiful explanation. Thank you so much!
Ответитьwhat if we declare array[100] in the beginning and if we only input 15 values into the array, how are we supposed to get the length of the array? If I do that sizeof thing I will get 100, but I want 15.
Ответитьis ar already known to be array? why does it work when u divide size of ar instead of size of a?
Ответитьso there's no any built function for that
? 😢
Hi, i have size like 20, and in the array few element(s) i have. then how to find the length. i dont want to count junk elements.
ОтветитьNice mate!!!
ОтветитьGood video, but why is C++ such butt?
Ответитьwow thank you holy shit i was going crazy, like how the fk is the array size 12 if it only has 3 elements, u made it clear thanks
Ответитьin c++ I can't put AR[ ]
You use it on C how to use it in c++
That is a cool stunt :)
ОтветитьGreat Video!
ОтветитьAWESOME
Ответитьhow can we find the size of a dynamically allocated array?
Ответитьthat was awesome . I got the formula that I was seeking for. thank you very much for sharing this
ОтветитьThank you so much! I come from a Java background and this was giving me so much trouble in C++.
ОтветитьBut if I pass this array as a parameter to some function, then how to calculate its length ?
Ответитьvery good
Ответить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?
Ответить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)
i'm sorry, but these formula works with structures too?
Ответить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[].
Ответитьwhat is meaning of
s1=sizeof(*arr); ?
how to find sum of the array elements, if the number of array elements are given at the run time
ОтветитьThank you!
ОтветитьThank you! The instruction is very clear!
ОтветитьWhy don't you just say sizeof array divide size of element?
Ответить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!
Ответитьwhat is "stdafx.h"
Error 1 error C1083: Cannot open include file: 'stdafx.h': No such file or directory
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!!!
ОтветитьMo you'er the man, not only are you a great teacher you are good at what you do; thank you!
ОтветитьBut what if I don't know how many elements are going to be in the array?
Ответить