Delete An Array Element At A Specific Index | C Programming Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Note that this is a simple program for learning how to delete an array element, so we don't do any input validation. We could check to make sure that total entered is less than MAX_CAPACITY and greater than 0 using an if statement for example. We could also add a check to ensure the user entered an int value at all instead of something like "abc". But these things are left out of this video to focus on the problem of deleting the element. 🙂

PortfolioCourses
Автор

Had a C programming exam yesterday and your videos helped me a lot!

OCEAN-fcwl
Автор

Thank God for Java & Python with their string & array functionalities.

wonderfulworld
Автор

Unbelievable, so clear and understandable. thank you

naboulsikhalid
Автор

I started learning C this week after mastering Lua, and if I watch BroCode's C course, and want to know all the specifics of a something in C, you are now my go to!!!. I got some questions though. I understood that besides setting pointers to NULL, there is no way besides ASM to wipe them out of RAM (or allocating space to the adresses again), now here in this video example if you want to delete an element, you can't really from what I understood. When writing a program that might generate milions of new variables, and deletes others every time, doesn't RAM slowly fill up? How is that generally managed?

fabimawn
Автор

I have a question: Is there a way to get rid of the last trailing element after the data is shifted forward? The "4" still remains in memory at array[5] after the data in the array is shifted. Is there a way to free the array[5]?

Also, I wanted to say I have been watching your videos since last semester lol. And thanks to you I have been able to pass all my classes. I am taking Data structure and Algo this semester. I definately feel my skills have improved and its all thanks to u! You have all these videos on how to do basic things in C; if i get confused I come here to your channel and I know what needs to be done. Thank you for these videos!

USAmerica-
Автор

if the size is 5 and i input 5 as the deleting element there should nothing to delete
so can you gave that code

jayasuryalift
Автор

I am sorry but how are we supposed to account for the last element in array because the declaration which we initially did(arr i = arr (i + 1) ) will work for every element except for the last element . This will happen so because the last element is supposed to be given a value which is not even there in array .
It would be great if you could clear my doubt . Thank you!

mayanksrivastava