Hi, im trying to create a function that gets two strings , the first string its the source , and the seconed is an understring .
the function should return an int with the value of the position that the understring starts in the source string . so that if ill have thie string as source : "abcdefg" and understring :"efg", than the function should return 5 because "efg" starts at the fifth character of the source string.
i need to do this with array pointers , so any1 has any idea ?
RisTar 0 Junior Poster in Training
Recommended Answers
Jump to PostIm trying to write my own function that does this with array pointers so there is no point to use an existing function .
So? Looking at and understanding an existing function is the way to learn how it's done. Then you can write your own using a similar (not …
Jump to Post>what do you think guys?
Your formatting is horried, void main is incorrect, gets is an extremely bad habit, and the algorithm is broken.Let's start with the formatting. Braces are there for a reason. They tell you when a block starts and when a block ends. However, if …
All 9 Replies
Lazaro Claiborn 1 Junior Poster
RisTar 0 Junior Poster in Training
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

iamthwee
RisTar 0 Junior Poster in Training
RisTar 0 Junior Poster in Training
Narue 5,707 Bad Cop Team Colleague
RisTar 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.