Removing an element from a char array (C) -


i'm trying remove char array , i'm having problems. read how numbers seems different removing chars it's not working me.

if i've following array:

char stuff[][20] = {"one", "two", "three", "four", "five"};      

how can remove element "four" example, can get

{"one", "two", "three", "five"};    

you dynamically allocating needed memory: array of char* memory strings.

then create array without item removed , copy data remains. free original array , strings.

it's bit complex not hard. may easier if create linked list - change application logic bit more.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -