Click here to Skip to main content
14,767,943 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
QuestionC code for fourth degree polynomials Pin
Member 1417766810-Mar-19 20:45
MemberMember 1417766810-Mar-19 20:45 
AnswerRe: C code for fourth degree polynomials Pin
Victor Nijegorodov10-Mar-19 23:27
MemberVictor Nijegorodov10-Mar-19 23:27 
AnswerRe: C code for fourth degree polynomials Pin
leon de boer12-Mar-19 4:56
Memberleon de boer12-Mar-19 4:56 
QuestionUnexpected sequence of cout / perror in console output Pin
Vaclav_10-Mar-19 8:23
MemberVaclav_10-Mar-19 8:23 
AnswerRe: Unexpected sequence of cout / perror in console output Pin
Richard MacCutchan10-Mar-19 23:52
mveRichard MacCutchan10-Mar-19 23:52 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
k505411-Mar-19 3:28
mvek505411-Mar-19 3:28 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
Richard MacCutchan11-Mar-19 4:56
mveRichard MacCutchan11-Mar-19 4:56 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
k505411-Mar-19 6:41
mvek505411-Mar-19 6:41 
Hmm.. I've compiled the OP's code and my own test code (below) and both times I get perror() and cout code interleaved. Not sure what I might be doing differently than the you guys. I've tried on both Fedora 29 (g++ v 8.3.1) and rpi (g++ v 6.3.0). Now I'm confused ...
$ cat errtest.cpp 
#include <iostream>
#include <cerrno>

using namespace std;

int main()
{
    for(errno= 0; errno < 4; ++errno) {
        cout << "errno = " << errno << endl;
        perror("Error");
    }
}
$ make errtest
g++ -Wall -Wextra -std=c++17 -O2    errtest.cpp   -o errtest
$ ./errtest 
errno = 0
Error: Success
errno = 1
Error: Operation not permitted
errno = 2
Error: No such file or directory
errno = 3
Error: No such process

GeneralRe: Unexpected sequence of cout / perror in console output Pin
Richard MacCutchan11-Mar-19 6:52
mveRichard MacCutchan11-Mar-19 6:52 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
k505411-Mar-19 12:59
mvek505411-Mar-19 12:59 
GeneralRe: Unexpected sequence of cout / perror in console output Pin
leon de boer11-Mar-19 19:10
Memberleon de boer11-Mar-19 19:10 
QuestionC Programming[Solved] Pin
Evolt_Pratom9-Mar-19 2:07
MemberEvolt_Pratom9-Mar-19 2:07 
AnswerRe: C Programming Pin
Richard MacCutchan9-Mar-19 2:27
mveRichard MacCutchan9-Mar-19 2:27 
GeneralRe: C Programming Pin
k50549-Mar-19 5:27
mvek50549-Mar-19 5:27 
GeneralRe: C Programming Pin
Richard MacCutchan9-Mar-19 6:16
mveRichard MacCutchan9-Mar-19 6:16 
GeneralRe: C Programming Pin
Evolt_Pratom10-Mar-19 4:42
MemberEvolt_Pratom10-Mar-19 4:42 
GeneralRe: C Programming Pin
Richard MacCutchan10-Mar-19 8:02
mveRichard MacCutchan10-Mar-19 8:02 
Questiontemplate confusion Pin
Rw2377-Mar-19 14:00
MemberRw2377-Mar-19 14:00 
AnswerRe: template confusion Pin
Rw2378-Mar-19 3:37
MemberRw2378-Mar-19 3:37 
GeneralRe: template confusion Pin
Richard MacCutchan8-Mar-19 5:01
mveRichard MacCutchan8-Mar-19 5:01 
GeneralRe: template confusion Pin
Victor Nijegorodov8-Mar-19 7:21
MemberVictor Nijegorodov8-Mar-19 7:21 
GeneralRe: template confusion Pin
Rw2379-Mar-19 7:08
MemberRw2379-Mar-19 7:08 
GeneralRe: template confusion Pin
k50548-Mar-19 7:50
mvek50548-Mar-19 7:50 
GeneralRe: template confusion Pin
Rw2379-Mar-19 6:57
MemberRw2379-Mar-19 6:57 
QuestionAero snap with CDockablePane Pin
jung-kreidler7-Mar-19 4:51
Memberjung-kreidler7-Mar-19 4:51 

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.