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
print word have length n
print word have length n
Apr 15, 2010 at 5:07pm UTC
bksekit
(5)
i have string
i want to print word has lengh is n
ex char *s="hello ! thank you"
n=5 print : 'hello' and 'thank'
Apr 15, 2010 at 5:46pm UTC
hamsterman
(4538)
well, I thin you could use strtok (
http://www.cplusplus.com/reference/clibrary/cstring/strtok/
) to get all the words separated and then strlen (
http://www.cplusplus.com/reference/clibrary/cstring/strlen/
) to see if it's length equals n
Topic archived. No new replies allowed.