Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Counting characters problem

$
0
0
Hey everybody! I have a homework question of which I would like some guidance in.

The general issue I am having with it is trying to count characters/letters of a string given by the user. The problem I'm running into is that I can only use FOR loops and I can't use any String or Array function. With this being said I am getting confused on what is a function. I have been using this website: C++ as a reference of what is or is not a function, assuming i'm reading correctly. In asking my professor, they responded with using a FOR loop to create the same aspect of a .length() or .size() function.

The only thing I have found that would work would be this:
for ( c != 0; ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) ; c++ )


where c is the user input for the string.

I am honestly lost at this point. Even if anybody can point me to someplace or website that could lead me in a better direction. I've read that you guys don't do homework which I would never ask for but I would like some guidance of some kind. Thanks!

Viewing all articles
Browse latest Browse all 51036

Trending Articles