Thread: program compiles but blk box just sits there

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    15

    Angry program compiles but blk box just sits there

    I am trying to read in a file that says:
    My name is Kristin Baten and I know how to program.
    R

    The 'R' is used as a key to reencode the above message. R is 17 letters away from'A'. Each letter in theoriginal message should be 17 letters ahead. The code I am attaching is only to figure out how far away the key is from 'A'
    Can anyone help with this???

  2. #2
    Registered User lobo's Avatar
    Join Date
    Oct 2001
    Posts
    71
    Your code loops in while loop at line #59 forever or until killed . That loop is quite useless there...

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    15
    Thanks Lobo,

    My instructor helped me to figure that out. I have revised the program now I have another loop.... What I am trying to do is to re-encode the original message by using the encoding key as the beginning of the alphabet instead of A. So my alphabet starts with R. This will in turn change my original message. The way I am doing the swapping is tedious, but I can't think of another way. I am attaching the new code.

    The output file reads:

    My name is Kristin Baten and I know how to program.

    R

    The output I am getting is a file full of n's.

  4. #4
    Registered User lobo's Avatar
    Join Date
    Oct 2001
    Posts
    71
    Your loop should be based on counter value (while (conter < 52)), not on sentence[counter] - you want loop over all characters of old sentence, no? You should init counter to 0 and increment it in each iteration of loop until you process whole sentence...

  5. #5
    Registered User
    Join Date
    Oct 2003
    Posts
    15
    I am not getting letters in my output. Do I have the static cast statements in correctly?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. program compiles, runs, but produces no output
    By happyclown in forum C Programming
    Replies: 11
    Last Post: 01-28-2009, 05:43 AM
  2. Program compiles; won't build
    By Kayoss in forum C++ Programming
    Replies: 1
    Last Post: 05-12-2006, 09:46 AM
  3. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  4. Dialog Box & Property Sheet :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 08-01-2002, 01:33 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM