| | |
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 |
Tag cloud for C
* adobe api append array arrays bash binarysearch centimeter char character cm copyanyfile copypdffile createcopyoffile createprocess() csyntax directory drawing dynamic executable execv feet fgets file floatingpointvalidation fork frequency function getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux highest homework i/o ide infiniteloop initialization interest intmain() keyboard kilometer lazy license linked linkedlist linux linuxsegmentationfault list match matrix meter microsoft mqqueue multi mysql oddnumber odf open openwebfoundation pause pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition scheduling segmentationfault send shape single socketprogramming spoonfeeding stack standard strchr string strings student suggestions system test testautomation unix urboc user whythiscodecausesegmentationfault win32api windows.h






