it's for my computing course at uni. i need to manipulate the number as an integer. simply just to show that i can. my ideas so far are to read them as seperate integers and them join them together some how though i'm not sure how to do that i thought that maybe there was a way to read it as a string skipping the hyphens then converting it to an integer which is what i tried to do above but can't get it right
Adak suggested one algorithm, but it's somewhat inefficient. Consider two pointers (or indices) into the string. One of them is the end of your result and the other walks along the original string and skips over hyphens. This is a common algorithm for removing whitespace, but it can be specialized to hyphens or even generalized:
Thanks heaps for the help. I got it with an added while() and moved the rest of the string back one place each time there was a hyphen. i realise this is not the most efficient way but i'm glad it worked in the end.
haven't tried narue's last suggestion but will have a look now