Click here to Skip to main content
15,901,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is the different between Synchronization and block? Pin
yu-jian22-Sep-10 5:07
yu-jian22-Sep-10 5:07 
QuestionHow to change color in vs2008 feature pack? Pin
hanlei000000000919-Sep-10 15:40
hanlei000000000919-Sep-10 15:40 
QuestionAutoComplete with CListCtrl ? Pin
mesajflaviu19-Sep-10 8:22
mesajflaviu19-Sep-10 8:22 
AnswerRe: AutoComplete with CListCtrl ? Pin
«_Superman_»19-Sep-10 20:52
professional«_Superman_»19-Sep-10 20:52 
GeneralRe: AutoComplete with CListCtrl ? Pin
mesajflaviu20-Sep-10 7:13
mesajflaviu20-Sep-10 7:13 
QuestionGetting window name in different language. Pin
gateway2319-Sep-10 2:20
gateway2319-Sep-10 2:20 
AnswerRe: Getting window name in different language. Pin
AmbiguousName19-Sep-10 4:13
AmbiguousName19-Sep-10 4:13 
AnswerRe: Getting window name in different language. Pin
Luc Pattyn19-Sep-10 5:07
sitebuilderLuc Pattyn19-Sep-10 5:07 
GeneralRe: Getting window name in different language. Pin
CPallini19-Sep-10 6:10
mveCPallini19-Sep-10 6:10 
GeneralRe: Getting window name in different language. Pin
Luc Pattyn19-Sep-10 6:16
sitebuilderLuc Pattyn19-Sep-10 6:16 
GeneralRe: Getting window name in different language. Pin
CPallini19-Sep-10 6:25
mveCPallini19-Sep-10 6:25 
QuestionRe: Getting window name in different language. Pin
CPallini19-Sep-10 6:07
mveCPallini19-Sep-10 6:07 
AnswerRe: Getting window name in different language. Pin
Luc Pattyn19-Sep-10 6:21
sitebuilderLuc Pattyn19-Sep-10 6:21 
GeneralRe: Getting window name in different language. Pin
CPallini19-Sep-10 6:26
mveCPallini19-Sep-10 6:26 
GeneralRe: Getting window name in different language. Pin
gateway2320-Sep-10 20:45
gateway2320-Sep-10 20:45 
QuestionListbox control not accessible in another class?? Pin
AmbiguousName19-Sep-10 1:48
AmbiguousName19-Sep-10 1:48 
AnswerRe: Listbox control not accessible in another class?? Pin
Richard MacCutchan19-Sep-10 2:07
mveRichard MacCutchan19-Sep-10 2:07 
AnswerRe: Listbox control not accessible in another class?? [modified] Pin
AmbiguousName19-Sep-10 2:37
AmbiguousName19-Sep-10 2:37 
GeneralRe: Listbox control not accessible in another class?? Pin
Richard MacCutchan19-Sep-10 7:21
mveRichard MacCutchan19-Sep-10 7:21 
AnswerRe: Listbox control not accessible in another class?? Pin
Luc Pattyn19-Sep-10 3:54
sitebuilderLuc Pattyn19-Sep-10 3:54 
AnswerRe: Listbox control not accessible in another class?? Pin
AmbiguousName19-Sep-10 4:05
AmbiguousName19-Sep-10 4:05 
GeneralRe: Listbox control not accessible in another class?? Pin
Luc Pattyn19-Sep-10 4:18
sitebuilderLuc Pattyn19-Sep-10 4:18 
Questionconnection dde server to excel Pin
zon_cpp18-Sep-10 20:45
zon_cpp18-Sep-10 20:45 
Questionfstream, fail() Pin
James_72218-Sep-10 18:48
James_72218-Sep-10 18:48 
AnswerRe: fstream, fail() Pin
Aescleal18-Sep-10 21:10
Aescleal18-Sep-10 21:10 
The artifacts are due to the way you're controlling the loop. Check what std::istream::get actually returns. Note that your cyphertext already has an extra character in it so your encrypt is part of the problem.

Just out of interest, as you're programming in C++ and not C:

- get rid of all the explicit opens/closes, you don't need them, destructors are wonderful things
- instead of letting a user crash your code by entering a filename of longer than 200 characters use std::strings and std::getline
- don't use macros, a pair of functions would have worked as well and enabled you to use the same code for encryption and decryption (the same goes for C BTW)

I'd also consider splitting the encrypt/decrypt bits of your code from all the guff asking for filenames, then you'd have something you can unit test without all the nuts ache of entering files all the time.

Cheers,

Ash

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.