C. please help

1. Open the file w.pdf to read. You are to write a series of statements that computes the number of bytes in w.pdf and in a printf statement output the number of bytes in the file w.pdf.
2. Open a file new.pdf to write. You need to read each character from w.pdf and write to new.pdf
3. Declare an array
long freq[256]={0};
Reset the file position indicator to the beginning of the file for the file w.pdf , read each character in w.pdf and determine how many times each character occurs in the file.
example if ch==i then freq++
after reading the entire file output the frequency count in a formatted manner printing six frequencies on each line.
4. (optional) An example of a weak encryption: reset the file position indicator to the beginning of the file for the file w.pdf and open a file called encryptFile. Prompt the user to enter an unsigned long, assign it to an unsigned long called key. Read each byte B from w.pdf and write the byte C= B^ (key & 0xff). Then set key=(key<<8)| (C&0xff) and then continue this process or reading and writing until EOF
5. (extra credit must be turned in to the instructor) Write a function that will decrypt your encrypted file encryptFile.


help me

dilaal1@hotmail.com
6 answers Last reply
More about help
  1. :lol: But you'll feel so much better if you earn your grade yourself.
  2. you should do this yourself though here is some reference stuff that will help http://www.cplusplus.com/reference/clibrary/cstdio/

    its a c++ site, though this is the stdio library for c, these are all of the functions that have to do with files in c
  3. Here we go again!
  4. That assignment takes a few lines of code. I would strongly urge you to figure it out yourself or you will certainly fail the class.
  5. 1. Open the file w.pdf to read. You are to write a series of statements that computes the number of bytes in w.pdf and in a printf statement output the number of bytes in the file w.pdf.
    2. Open a file new.pdf to write. You need to read each character from w.pdf and write to new.pdf
    3. Declare an array
    long freq[256]={0};
    Reset the file position indicator to the beginning of the file for the file w.pdf , read each character in w.pdf and determine how many times each character occurs in the file.
    example if ch==i then freq++
    after reading the entire file output the frequency count in a formatted manner printing six frequencies on each line.
    4. (optional) An example of a weak encryption: reset the file position indicator to the beginning of the file for the file w.pdf and open a file called encryptFile. Prompt the user to enter an unsigned long, assign it to an unsigned long called key. Read each byte B from w.pdf and write the byte C= B^ (key & 0xff). Then set key=(key<<8)| (C&0xff) and then continue this process or reading and writing until EOF
    5. (extra credit must be turned in to the instructor) Write a function that will decrypt your encrypted file encryptFile.
  6. This next topics has been merged by Aford10
    C help me
Ask a new question

Read More

Programming PDF Encryption Apps