cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Lounge
Without using built-in functions or thir
Without using built-in functions or third party library
Oct 3, 2016 at 4:53am UTC
Student555
(48)
How would one determine if a string literal is a digit, alphabetic character or symbol character (!,@, {, }, $, ^, %, etc) without relaying on ready made functions? Explanation with some sample code would be nice.
Oct 3, 2016 at 5:44am UTC
SakurasouBusters
(732)
Simple.
1. Use simple logic with if statements.
if
(c >=
'a'
&& c <=
'z'
)
2. Use a table.
const
char
*numTable =
"0123456789"
;
Oct 5, 2016 at 11:49pm UTC
cire
(8284)
Is there a reason you're specifying a string literal as opposed to a string?
Topic archived. No new replies allowed.