hey guys does any one has idea how to write a program which calculates all the characters in a sentence
farhanp
0
Newbie Poster
Recommended Answers
Jump to Poststrlen() will tell you hows many characters are in a string. If you are not allowed to use that function then count each character in a loop from the beginning of the string until the null-terminating character 0 is reached.
Jump to PostI thank you use string lenth function to find the string length ...
String::length();
or used loop couter variable like i=0 a and if string!='\0';i++ then print i ...may be i am not right but you check one time....
Jump to PostOh, that's fairly easy to do, once you realize that there is a maximum of 256 possible characters, of which only about half are printable characters. So, the first thing you want to do is create an array of 256 integers, initialize them all to 0. Then loop through the …
All 11 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Caeon
0
Light Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
asifalizaman
1
Junior Poster
farhanp
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
deceptikon
commented:
"mian". :D
+12
farhanp
0
Newbie Poster
NathanOliver
429
Veteran Poster
Featured Poster
$Tweety$
-3
Newbie Poster
deceptikon
commented:
If I *tried* to write bad code it would look something like that.
-3
farhanp
0
Newbie Poster
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
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.