cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
how to store a range of cstring values
how to store a range of cstring values
Sep 28, 2015 at 2:42am UTC
MooseInTheSack
(7)
1
Last edited on
Nov 1, 2015 at 1:31am UTC
Sep 28, 2015 at 3:03am UTC
codewalker
(394)
Look at strchr, strrchr and strncpy.
general logic is
1) Locate last occurrence of bracket
2) Locate first occurrence of bracket
3) calculate the difference in the positions of these (say call it diff)
4) use strncpy to copy "diff" number of characters starting from first occurrence
Topic archived. No new replies allowed.