Hey everyone I've got a char array which holds an ID field. The id field looks as follows i0001. I want to increment the ID by one when i create a new link in my linked list.
So I sort through the linked list to the last value, which is for example; i0005, now I want to create my new field as i0006. Obviously I can't just increment the value of the array because it's a char, how should I go about this?
char id[5];
I tried:
id[4] = id[4]+1;
The issue with this is it doesn't increment id[3] when it hits 10, instead it starts replacing the numerical value with symbols (i assume these are the ascii values after number).
Anyone got any idea of how they would approach this? I'm a bit stumped!