Click here to Skip to main content
11,578,954 members (65,779 online)

C / C++ / MFC

 
QuestionRe: Shred a folder Pin
DavidCrow27-Nov-12 6:04
memberDavidCrow27-Nov-12 6:04 
GeneralRe: Shred a folder Pin
Richard MacCutchan27-Nov-12 6:29
mvpRichard MacCutchan27-Nov-12 6:29 
QuestionRe: Shred a folder Pin
DavidCrow27-Nov-12 6:03
memberDavidCrow27-Nov-12 6:03 
AnswerRe: Shred a folder Pin
jschell27-Nov-12 13:08
memberjschell27-Nov-12 13:08 
GeneralRe: Shred a folder Pin
MehdiHazrati27-Nov-12 17:45
memberMehdiHazrati27-Nov-12 17:45 
GeneralRe: Shred a folder Pin
jschell28-Nov-12 8:33
memberjschell28-Nov-12 8:33 
Questiondo-while did not work Pin
ho_khalaf26-Nov-12 19:36
memberho_khalaf26-Nov-12 19:36 
AnswerRe: do-while did not work Pin
Andy41126-Nov-12 19:55
memberAndy41126-Nov-12 19:55 
As mentioned in the QA section: Please don't cross post. I decided to answer you here.

Did you take a look at "again" in the debugger? You will recognize that in the second round thru the loop it will have the value 0x0a == \r it's the carriage return from your input.

You can try something like this to catch the CR:

char cr;
char again;
do
{
    printf("insert y or Y to repeat");
    fflush(stdout);
 
    again = getchar();
    cr = getchar();
 
}while(again=='y'||again=='Y');

GeneralRe: do-while did not work Pin
ho_khalaf26-Nov-12 20:04
memberho_khalaf26-Nov-12 20:04 
GeneralRe: do-while did not work Pin
Andy41126-Nov-12 20:08
memberAndy41126-Nov-12 20:08 
AnswerRe: do-while did not work Pin
water-moon201226-Nov-12 20:20
memberwater-moon201226-Nov-12 20:20 
Questioneclipse Pin
ho_khalaf26-Nov-12 8:02
memberho_khalaf26-Nov-12 8:02 
QuestionRe: eclipse Pin
Maximilien26-Nov-12 8:04
memberMaximilien26-Nov-12 8:04 
AnswerRe: eclipse Pin
ho_khalaf26-Nov-12 8:08
memberho_khalaf26-Nov-12 8:08 
AnswerRe: eclipse Pin
Richard MacCutchan26-Nov-12 8:15
mvpRichard MacCutchan26-Nov-12 8:15 
Questiondo-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 6:50
memberho_khalaf26-Nov-12 6:50 
AnswerRe: do-while did not work in eclipse c\c++ IDE ? Pin
Chris Meech26-Nov-12 7:07
memberChris Meech26-Nov-12 7:07 
AnswerRe: do-while did not work in eclipse c\c++ IDE ? Pin
Richard MacCutchan26-Nov-12 8:00
mvpRichard MacCutchan26-Nov-12 8:00 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 8:12
memberho_khalaf26-Nov-12 8:12 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
Richard MacCutchan26-Nov-12 8:14
mvpRichard MacCutchan26-Nov-12 8:14 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 8:16
memberho_khalaf26-Nov-12 8:16 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 8:20
memberho_khalaf26-Nov-12 8:20 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
Richard MacCutchan26-Nov-12 8:22
mvpRichard MacCutchan26-Nov-12 8:22 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
ho_khalaf26-Nov-12 8:27
memberho_khalaf26-Nov-12 8:27 
GeneralRe: do-while did not work in eclipse c\c++ IDE ? Pin
Richard MacCutchan26-Nov-12 8:57
mvpRichard MacCutchan26-Nov-12 8:57 

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

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


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 5 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid