basically i have a function that passes an array of characters, it will be a phone number and i want to copy the numbers into a string in the format of the first 3, then the next three then the last 4.
is there a way to set where i start my copy from in strcpy or is there another function i can use that will assist in doing this?
I don't understand... What do you mean, "copy the numbers into a string in the format of the first 3, then the next three then the last 4."? You want three separate strings?
basically i have a function that passes an array of characters, it will be a phone number and i want to copy the numbers into a string in the format of the first 3, then the next three then the last 4.
is there a way to set where i start my copy from in strcpy or is there another function i can use that will assist in doing this?
Is your string a char array, or a string?
If it's a char array, just add the offset for the start position you want to the source pointer you pass to strcpy.
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
Bookmarks