How would u determine the end of a word using pointers?
samli88 0 Newbie Poster
Recommended Answers
Jump to PostHow would u determine the end of a word using pointers?
Here's an approach:
- First you read away all whitespaces.
- Then you read until you come across a non-alphabet character.
- Now you stop because you've reached the end of a word.
Jump to Post1)read the string charecter wise (one char at a time) until you find a space.
here is your word.Won't work if the string starts with spaces, what about a string like this:
" firstword"
.
However, it will work if you first skip all whitespaces.
All 7 Replies
tux4life 2,072 Postaholic
Dream2code 12 Junior Poster
tux4life 2,072 Postaholic
Dream2code 12 Junior Poster
tux4life 2,072 Postaholic
samli88 0 Newbie Poster
tux4life 2,072 Postaholic
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.