cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
What do these lines of code mean?
What do these lines of code mean?
Jun 24, 2015 at 4:09pm UTC
Wulfinite
(60)
Question says it all.
1
2
3
4
5
6
//Number 1:
int
length; length = (
int
)input.length();
//Number 2:
isalpha(input[count])
Last edited on
Jun 24, 2015 at 4:10pm UTC
Jun 24, 2015 at 4:23pm UTC
MiiNiPaa
(8886)
1) c-style cast:
http://en.cppreference.com/w/cpp/language/explicit_cast
2) Check if character is alphabet character
http://en.cppreference.com/w/cpp/string/byte/isalpha
Jun 25, 2015 at 5:18pm UTC
Wulfinite
(60)
And how bout this part:
(input[count])
Jun 25, 2015 at 5:34pm UTC
AbstractionAnon
(6954)
You didn't show the definition of input, but presumably it is a std::string.
input[n] returns the n'th character of the string.
http://www.cplusplus.com/reference/string/string/operator[]/
Jun 25, 2015 at 5:34pm UTC
MiiNiPaa
(8886)
http://www.cplusplus.com/doc/tutorial/arrays/
Topic archived. No new replies allowed.