•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 392,369 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,768 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:
Views: 5168 | Replies: 63
![]() |
No...I think you dont get the logic.
Do the same for the other loop.
cpp Syntax (Toggle Plain Text)
while( ! ischar( str[i] ) ) { ++i ; } // increment the counter here since "i" points to an alphabet counter[str[i]] ++ ;
Do the same for the other loop.
"I don't accept change. I don't deserve to live."
"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
I wont write teh code but give you a general algo:
1. Move through the array counter.
2. If at an index i you encounter a value > 0 display the equivalent character of i.
3. After the above condition is satisfied, start a for loop which will print out the number of stars which equals the vaule of the counter for that particular i in front of the character.
1. Move through the array counter.
2. If at an index i you encounter a value > 0 display the equivalent character of i.
3. After the above condition is satisfied, start a for loop which will print out the number of stars which equals the vaule of the counter for that particular i in front of the character.
"I don't accept change. I don't deserve to live."
"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
Other Threads in the C Forum
- Previous Thread: string-structure
- Next Thread: Arrays: Finding Smallest String



Linear Mode