>>3
Please, bolding a name is better effective when implying `You're person, aren't you?' where person is previously known by at least one other /anus/dolyte, and exhibits traits present in the post quoted.
Macros do replacement without taking account namespace rules etc. So macro should expand test::X to test::int
which is non-sensical. Just using X should have been good.
K so my programming teacher is new and sucks balls at communicating anything, so I'm having serious issues with this assignment. Can anyone set up at least a pseudocode explanation of how to do this program in C?
Here's the details of what it should do:
You must create two programs that encode and decode plain text files. The encryption is a simple cipher, replacing each alphanumeric symbol with a shifted value. Here are two examples:
Only letter (upper and lower case) and numeric (0 through 9) symbols should be affected. All other symbols should pass through encryption and decryption unaffected. The shifting of a symbol should wrap-around its set. For example, the symbol “a” shifted -1 should become “z”. The symbol “9” shifted +1 should become “0”. The symbol “Z” shifted +2 should become “B”. This is also demonstrated in the examples above.
The first program should encode text. It should prompt for one word (string) at a time, encode it, and print out the encoded version. This should continue until the single symbol “.” is given as input, which should terminate the program. The first program must accept a single command line argument defining the shift delta. The value of delta must be an integer between -9 and +9, inclusive.
The second program should decode encrypted text. It should be unaware of the value of delta used to encode the text. Instead, it must figure out the value of delta by trying to decrypt using all possible values for delta and examining the resulting text. To examine the result, the program must use the dictionary stored in the linux.words file. It should compare every potential decrypted word with the dictionary, looking for a match. Whichever value for delta produces the most matches with words in the dictionary should be assumed to be the correct value for delta. The program should print out the decrypted text using that value of delta (and it should not print out anything else).
Assume that the message being encrypted or decrypted consists of less than 100 words, and that no word is longer than 30 characters.
>>20
First implement a function char *str_shift(const char *s, int how_much); and make sure it really works. Then, write a function int match_score(char *c); that takes every word in /usr/share/dict/words, ignoring 1-letter words, and tries to match it against the string, adding the length of the word to the score every time the word is matched. The rest should be fairly trivial.
>>28
should be fine for most modern unicies, he may have to adjust his paths to suit
see also: fairly trivial
Name:
Anonymous2010-10-01 21:06
>>1
No compiler should accept this, and I'm not familiar
with any such extension in VC7 or elsewhere.
Could you post the exact code that lead you to your conclusion?