Click here to Skip to main content
14,484,721 members

C / C++ / MFC

 
AnswerRe: SOLVED cout and cerr execute out of coded sequence Pin
Richard MacCutchan21-Dec-19 21:32
mveRichard MacCutchan21-Dec-19 21:32 
AnswerRe: CASE SOLVED AND CLOSED cout and cerr execute out of coded sequence Pin
Richard MacCutchan22-Dec-19 22:55
mveRichard MacCutchan22-Dec-19 22:55 
QuestionSOLVED CASE CLOSED cout in color and perror - revisited Pin
Vaclav_20-Dec-19 4:46
MemberVaclav_20-Dec-19 4:46 
AnswerRe: cout in color and perror - revisited Pin
leon de boer20-Dec-19 5:01
Memberleon de boer20-Dec-19 5:01 
GeneralRe: cout in color and perror - revisited Pin
Vaclav_20-Dec-19 5:48
MemberVaclav_20-Dec-19 5:48 
AnswerRe: cout in color and perror - revisited Pin
Richard MacCutchan20-Dec-19 6:07
mveRichard MacCutchan20-Dec-19 6:07 
GeneralRe: cout in color and perror - revisited Pin
Vaclav_21-Dec-19 3:10
MemberVaclav_21-Dec-19 3:10 
GeneralRe: cout in color and perror - revisited Pin
Richard MacCutchan21-Dec-19 3:34
mveRichard MacCutchan21-Dec-19 3:34 
It's nothing special, just print the start test line, then two samples of perror, the first with no error, and the second with error 5.
cout << "Function: " << __FUNCTION__ << endl;
cout << " START test area " << __LINE__ << endl;
errno = 0;
perror("\033[1;31mTEST perror "); // print the error details in red
cout << "\033[0m\n";              // restore to standard colours
errno = 5;
perror("\033[1;31mTEST perror ");
cout << "\033[0m\n";

Quote:
Since this is a TEST code , the while(1); purpose is to stop code flow.
Not sure what that means as there is nothing to stop.
GeneralRe: cout in color and perror - revisited Pin
Vaclav_21-Dec-19 9:05
MemberVaclav_21-Dec-19 9:05 
GeneralRe: cout in color and perror - revisited Pin
Richard MacCutchan21-Dec-19 21:25
mveRichard MacCutchan21-Dec-19 21:25 
QuestionHow to close file in C++? Pin
Vaclav_19-Dec-19 17:13
MemberVaclav_19-Dec-19 17:13 
QuestionRe: How to close file in C++? Pin
CPallini19-Dec-19 21:35
mveCPallini19-Dec-19 21:35 
AnswerRe: How to close file in C++? Pin
Stefan_Lang19-Dec-19 21:59
mveStefan_Lang19-Dec-19 21:59 
AnswerRe: How to close file in C++? Pin
Vaclav_20-Dec-19 4:51
MemberVaclav_20-Dec-19 4:51 
AnswerRe: How to close file in C++? Pin
Richard MacCutchan19-Dec-19 21:56
mveRichard MacCutchan19-Dec-19 21:56 
QuestionDo "setw(offset) " BEFORE cout ? Pin
Vaclav_18-Dec-19 4:22
MemberVaclav_18-Dec-19 4:22 
AnswerRe: Do "setw(offset) " BEFORE cout ? Pin
Richard MacCutchan18-Dec-19 4:56
mveRichard MacCutchan18-Dec-19 4:56 
AnswerRe: Do "setw(offset) " BEFORE cout ? Pin
leon de boer18-Dec-19 5:19
Memberleon de boer18-Dec-19 5:19 
GeneralRe: Do "setw(offset) " BEFORE cout ? Pin
Vaclav_19-Dec-19 17:26
MemberVaclav_19-Dec-19 17:26 
GeneralRe: Do "setw(offset) " BEFORE cout ? Pin
Richard MacCutchan19-Dec-19 21:50
mveRichard MacCutchan19-Dec-19 21:50 
AnswerRe: Do "setw(offset) " BEFORE cout ? Pin
CPallini18-Dec-19 10:43
mveCPallini18-Dec-19 10:43 
GeneralRe: Do "setw(offset) " BEFORE cout ? Pin
Vaclav_19-Dec-19 17:14
MemberVaclav_19-Dec-19 17:14 
QuestionLoadString Pin
Member 1450258316-Dec-19 23:36
MemberMember 1450258316-Dec-19 23:36 
AnswerRe: LoadString Pin
Daniel Pfeffer16-Dec-19 23:44
professionalDaniel Pfeffer16-Dec-19 23:44 
AnswerRe: LoadString Pin
Richard MacCutchan16-Dec-19 23:47
mveRichard MacCutchan16-Dec-19 23:47 

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.