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?

Recommended Answers

All 2 Replies

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

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 =) .

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.