|
-
November 11th, 2010, 03:29 PM
#3
Re: copying a string
 Originally Posted by turlisk
i have a question about copying a string.
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.
If it's a string, use substr().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|