In: Computer Science
I'm having trouble thinking of a way that I can delete duplicates from a c string of alphabets. So what I'm supposed to do is I'm supposed to delete the repeated letters in the c string using pointers and also dynamically allocating space. I'm guessing that I will have to dynamically allocate space for an array to put in the letters that only appear once. To do that, can I create 2 pointers in a function and have 1 pointer go through a source array that I will pass through in the main function and make another pointer that will be pointed to the dynamically allocated array and return that pointer to the main function to print out the dynamic array that will contain the letters that only appear once and then delete it afterwards. I'm a little new to this dynamic allocation concept.