Help with String tokens

Hi All,
Have a project that require me to write a program that gets data from the user and you must calculate the wieght value of each word by using a given formula, by runing the formula through every letter in the word then adding the total. I used "strtok" to get the words seprated but i still need to get them seprated into letters to run the formula on each one or do i? thanks and hope you guys/girls understood what i am saying.
J
Use a loop.
1
2
3
4
5
6
7
const char greeting[] = "Hello world!";
int i;

for (i = 0; i < strlen( greeting ); i++)
  printf( "%c", greeting[ i ] );

printf( "\n" );
Last edited on
Topic archived. No new replies allowed.