| | |
character processing
![]() |
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.
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 binarysearch calculate centimeter char character cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking highest homework i/o inches incrementoperators intmain() iso km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. lowest match matrix microsoft mqqueue mysql oddnumber odf open opendocumentformat openwebfoundation pattern pdf performance posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string suggestions test unix urboc user variable voidmain() whythiscodecausesegmentationfault win32api windows.h windowsapi







