Actually with C it's very easy (I've been learning alot of languages while not around). Basically you do something similar to this:
#include <stdio>;
main (str[128]) {
int position;
int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, x, y, z;
position = 1;
while (position <= 128) {
if (str[position] != ("a" || "b || "c" || "d" || "e" || "f" || "g" || "h" || "i" || "j" || "k" || "l" || "m" || "n" || "o" || "p" || "q" || "r" || "s" || "t" || "u" || "v" || "w" || "x" || "y" || "z")) {
position++;
}
if (str[position] == "a" ) { a++; }
if (str[position] == "b" ) { b++; }
if (str[position] == "c" ) { c++; }
if (str[position] == "d" ) { d++; }
if (str[position] == "e" ) { e++; }
if (str[position] == "f" ) { f++; }
if (str[position] == "g" ) { g++; }
if (str[position] == "h" ) { h++; }
if (str[position] == "i" ) { i++; }
if (str[position] == "j" ) { j++; }
if (str[position] == "k" ) { k++; }
if (str[position] == "l" ) { l++; }
if (str[position] == "m" ) { m++; }
if (str[position] == "n" ) { n++; }
if (str[position] == "o" ) { o++; }
if (str[position] == "p" ) { p++; }
if (str[position] == "q" ) { q++; }
if (str[position] == "r" ) { r++; }
if (str[position] == "s" ) { s++; }
if (str[position] == "t" ) { t++; }
if (str[position] == "u" ) { u++; }
if (str[position] == "v" ) { v++; }
if (str[position] == "w" ) { w++; }
if (str[position] == "x" ) { x++; }
if (str[position] == "y" ) { y++; }
if (str[position] == "z" ) { z++; }
}
}
Ok, now other members of the board are going to yell at me for this not being in basic, or for solving someone's homework, but I actually provided a subtle hint, and a probable (but very bloated) solution.
TO Kuul:
What function in basic allows you to access part of a string just like it was in a character array?
What is wrong with my solution, did I forget to validate some input (does it have to do anything with case?)
How might I go about fixing that? (Think $CHR)
Would it be dangerous if someone entered a sentence with more than 128 characters? Why?
Please reply!