| | |
character processing
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Well, suppose you have the string "GIRL". A string is an array of characters. Store the letter you want to search for as a character. So what you will have to do is start at the beginning of the array, and recursively traverse it one character at a time. We look at the first character. Is it equal to our search character? If yes, increment our counter. Move to the second element (character) in the array. Check if it is a match. Then move to the next character, etc.
Dani the Computer Science Gal 
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds

Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
i think you mean || (or) instead of && (and), other than that what you posted should work.
As for the other ? , If you know the length of the file, you can stop immedietly once a certian frequency has been found.
As for the other ? , If you know the length of the file, you can stop immedietly once a certian frequency has been found.
A Hacker's Mind:
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes..." - J.D.Salinger
•
•
Join Date: Mar 2004
Posts: 5
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by machakwa
can i use if statement to count the frequency
for example
c=getchar()
if c='a' && 'A'
cnta++
.....to if c=z...
and one more question
when more than one characters have the same frequencies
how can i take out the earlier one ?
![]() |
Similar Threads
Other Threads in the C Forum
- Previous Thread: Library compatibility problem?
- Next Thread: Screenshot
| Thread Tools | Search this Thread |
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory dynamic fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming stack standard string strings structures systemcall testautomation turboc unix user variable voidmain() wab win32api windows.h






