0

Hi folks,

I've been trying to solve this but I keep hitting a brick wall. Here's what I am trying to do: I'm reading a file with text in it, I am storing every letter of this file as an element of this array (this part is already done) and I've also terminated the array with \0. Now, I want to be able to count how many repetitions are for each letter.

What I was thinking of doing is:

- Create a new array to hold the letters (E.g letters [26] (english alphabet only)
- The array would look like {45,23,434,35,....,90}
- So if letter[0] = 45 that would mean there are 45 a's or letter[1] = 99 there are 99 b's

What I'm having problems with is, how do I iterate through textStr and add this type of functionality?

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by Ral78
0

Ok we have a breakthrough! I managed to do this after some digging into arrays :)

Now I'm trying to figure out how to normalize the views when printing

0

What exactly do you mean by normalize the views when printing. Can you copy and paste the source code so I can compile it and see what you mean. It sounds very interesting =) .

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.