How to organise a composition analyzer??

J

jyck91

I want to get some ideas to organise a composition analyzer??
eg. frequencies of letters

Thx for your suggestion
 
T

Tor Rustad

I want to get some ideas to organise a composition analyzer??
eg. frequencies of letters

unsigned long freq[MAX_ALPHABETH];

[...]

while (c)
freq[c]++;


and I have no clue what a composition analyzer is.
 
A

Army1987

I want to get some ideas to organise a composition analyzer??
eg. frequencies of letters

Thx for your suggestion
Get a copy of Brian W. Kernigham & Dennis M. Ritchie, "The C
Programming Language" 2nd edition, and read chapter 1.
 
C

Christopher Benson-Manica

[comp.lang.c] Tor Rustad said:
and I have no clue what a composition analyzer is.

void analyze_composition( char *composition ) {
if( strstr(composition,"Four score and seven years ago") ) {
printf( "Ah, this seems to be the Gettysburg Address.\n" );
}
else if( strstr(composition,"What is the capital of Assyria?") ) {
printf( "This appears to be a Monty Python sketch, old chap.\n" );
}
else if( strstr(composition,"lcc-win32 can do that") ) {
printf( "Um, it looks like a comp.lang.c post by Jacob Navia...\n" );
}
else {
printf( "D'oh. I'm sure it's a lovely composition, whatever it is.\n" );
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top