Removing elements from an array in C
I just have a simple question about arrays in C What's the best way to remove elements from an array and in the process make the array smaller. i.e the array is n size, then I take elements out of the array and then the array grows smaller by the amount that I removed it from. basically I'm treating the array like a deck of cards and once I take a card off the top of the deck it shouldn't be there anymore. EDIT: I'm going to drive myself crazy before the end of the day, thanks for all the help I'm trying the value swapping thing but it's not working right. #include <stdio.h> #include <string.h