Counting Array Elements using sizeof() Operator

preview_player
Показать описание
C Programming: Count Array Elements by using sizeof() Operator in C Programming.
Topics discussed:
1) C program to find the number of elements in an array using sizeof() operator.

Music:
Axol x Alex Skrindo - You [NCS Release]

#CProgrammingByNeso #CProgramming #sizeofOperator #ArrayInC
Рекомендации по теме
Комментарии
Автор

u r great man who can attract most of the students by your words

ysailokesh
Автор

You are a real gem. We need more teachers like you.
Thank you.

anuragpimpalkar
Автор

Happy teacher day sir
Thanku to make learning C so simple

palakgoyal
Автор

You just wrote 152 elements only to show us how the sizeof operator works!
Really admirable ❤

tayyab.sheikh
Автор

no no sir we are not angry with you...we just love you ..the best teacher

sohelansari-dqkv
Автор

Amazing video Sir, very easy to understand not only this, but whole playlist...Thank you.

ayushpawar
Автор

Thank you so much! I was really struggling to understand summing arrays coming from python to c++, but you cleared it up perfectly!

patrickmccarthy
Автор

Thanks a lot sir...giving us a great content

devpatel
Автор

Genius men You are amazing love you got a follower, this show how much complex universities had made in some they don't even tell you this amazing man once again❤❤❤❤

mugheesahmed
Автор

Thanks a lot sir, giving us a great content

mdalaminhossian
Автор

thumbs up for simple and easy explanation

Make_it-Simple
Автор

U're awesome! thank you very much <3

saruulnasanjargal
Автор

I am normally using Python, but I would like to learn C++ as well.
Let's say I would like to create a function which would iterate through an array of integers:
1. I declare the function ahead... int arrayIterator(*int arrayInput) with a pointer to the array as an argument.
2. In the int main() function I declare an array and then pass it into the function arrayIterator.
3. The function arrayIterator under main function has a for loop, I would like to iterate through each element of the array.

To iterate through each element with a for loop, I need to know the size of the array. How do I get it from outside the main function? Is it even possible? The only way which worked and I came up with was to pass the size as a second argument (sizeof(arrayInput) / sizeof(arrayInput[0]))

tomasprejda