Click here to Skip to main content
15,885,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C3861: 'major': identifier not found Pin
_Flaviu7-Jan-20 0:29
_Flaviu7-Jan-20 0:29 
GeneralRe: error C3861: 'major': identifier not found Pin
Victor Nijegorodov7-Jan-20 0:40
Victor Nijegorodov7-Jan-20 0:40 
GeneralRe: error C3861: 'major': identifier not found Pin
_Flaviu7-Jan-20 1:07
_Flaviu7-Jan-20 1:07 
GeneralRe: error C3861: 'major': identifier not found Pin
Victor Nijegorodov7-Jan-20 1:13
Victor Nijegorodov7-Jan-20 1:13 
AnswerRe: error C3861: 'major': identifier not found Pin
Stefan_Lang8-Jan-20 21:58
Stefan_Lang8-Jan-20 21:58 
GeneralRe: error C3861: 'major': identifier not found Pin
_Flaviu8-Jan-20 22:04
_Flaviu8-Jan-20 22:04 
GeneralRe: error C3861: 'major': identifier not found Pin
Stefan_Lang8-Jan-20 22:40
Stefan_Lang8-Jan-20 22:40 
Questionsetw irrational behaviour Pin
Vaclav_5-Jan-20 8:25
Vaclav_5-Jan-20 8:25 
This is a corollary on an old issue of cout and perror (cerr) output not following expected sequence.
I understand that is caused by cout and perror(cerr) outputting to DIFFERENT streams. End of story for now.

Now I am having issues with inserting setw and left into cout NOT doing what I expect.
See attached IDE output. (Align cout text left starting on column set in setw.)


setw(30) without left is also being totally ignored, until width is set to 75 (?).


What gives?

PS in Linux if it should make a difference.

To avoid any unnecessary replies - usual note that I am looking for a solution to an issue, not for commentaries on my code style.

Cheers









C++
			else if (child > 0) { /* This is the parent. */

				//cout << setw(75) << left  << setw(75) << left  << "\033[1;31mINITIALIZE bold red text\033[0m\n";
				cout << setw(75) << left
						<< "\033[1;31mINITIALIZE bold red text\n" << flush;
				//cout << setw(75) << left  << setw(75) << left  << "\033[1;31mRESET  bold red text\033[0m\n";
				//	cout << setw(75) << left  << setw(75) << left  << "\033[1;32mbold green text\033[0m\n";
				cout << flush; // in << "" << endl;
				cout << setw(75) << left << "(offset 30 ) START PARENT PROCESS "
						<< endl;

#ifdef DEBUG
				cout << setw(75) << left
						<< "parent has / knows child process ID  " << dec
						<< child << endl;
				cout << setw(75) << left
						<< "TRACE  This is the parent, orignal process  "
						<< endl;
				cout << setw(75) << left << "TASK @line " << dec << __LINE__
						<< dec << endl;
				cout << setw(75) << left << "function " << __FUNCTION__ << endl;
				cout << setw(75) << left << "STOP  @line " << __LINE__ << endl;
				cout << setw(75) << left
						<< "child > 0 File descriptor socket[0] " << dec
						<< sockets[0] << endl;
				cout << setw(75) << left
						<< "child > 0 File descriptor socket[1] " << dec
						<< sockets[1] << endl;
#endif
				// why closing the other socket (?)



Actual output on IDE console

 START test area 370
main
TASK  create a pair of connected sockets 
TRACE  @line 403
SUCCESS opening stream socket pair 
result 0
socketpair File descriptor socket[0] 11
socketpair File descriptor socket[1] 12
TRACE  @line 420
TASK fork Create another process  child default -1
TASK @line 427
function main
TRACE  @line 429
INITIALIZE bold red text
                                           (offset 30 ) START PARENT PROCESS                                          
parent has / knows child process ID                                        11713
TRACE  This is the parent, orignal process                                 
TASK @line                                                                 451
function                                                                   main
STOP  @line                                                                453
child > 0 File descriptor socket[0]                                        11
child > 0 File descriptor socket[1]                                        12
child process , not ID ! 0
TRACE   This is the child. process  
TASK @line 513
function main

AnswerRe: setw irrational behaviour Pin
k50545-Jan-20 10:27
mvek50545-Jan-20 10:27 
GeneralRe: setw irrational behaviour Pin
Vaclav_5-Jan-20 17:37
Vaclav_5-Jan-20 17:37 
GeneralRe: setw irrational behaviour Pin
Richard MacCutchan5-Jan-20 21:53
mveRichard MacCutchan5-Jan-20 21:53 
GeneralRe: setw irrational behaviour Pin
k50546-Jan-20 4:16
mvek50546-Jan-20 4:16 
AnswerRe: setw irrational behaviour Pin
CPallini6-Jan-20 21:30
mveCPallini6-Jan-20 21:30 
Questionerror C2065: '_S_IFDIR' : undeclared identifier Pin
_Flaviu5-Jan-20 7:42
_Flaviu5-Jan-20 7:42 
AnswerRe: error C2065: '_S_IFDIR' : undeclared identifier Pin
k50545-Jan-20 10:31
mvek50545-Jan-20 10:31 
AnswerRe: error C2065: '_S_IFDIR' : undeclared identifier Pin
Richard MacCutchan5-Jan-20 21:28
mveRichard MacCutchan5-Jan-20 21:28 
QuestionC++ control textBox of Form1 and Form2 Pin
HeeMongKorea29-Dec-19 20:08
professionalHeeMongKorea29-Dec-19 20:08 
AnswerRe: C++ control textBox of Form1 and Form2 Pin
Richard MacCutchan29-Dec-19 22:02
mveRichard MacCutchan29-Dec-19 22:02 
AnswerRe: C++ control textBox of Form1 and Form2 Pin
Victor Nijegorodov30-Dec-19 0:37
Victor Nijegorodov30-Dec-19 0:37 
QuestionAbstract Factory Design/Linked List Problem Pin
EjireK28-Dec-19 4:59
EjireK28-Dec-19 4:59 
AnswerRe: Abstract Factory Design/Linked List Problem Pin
Richard MacCutchan28-Dec-19 5:51
mveRichard MacCutchan28-Dec-19 5:51 
GeneralRe: Abstract Factory Design/Linked List Problem Pin
EjireK28-Dec-19 6:14
EjireK28-Dec-19 6:14 
GeneralRe: Abstract Factory Design/Linked List Problem Pin
Richard MacCutchan28-Dec-19 6:29
mveRichard MacCutchan28-Dec-19 6:29 
GeneralRe: Abstract Factory Design/Linked List Problem Pin
EjireK28-Dec-19 12:18
EjireK28-Dec-19 12:18 
GeneralRe: Abstract Factory Design/Linked List Problem Pin
leon de boer28-Dec-19 14:53
leon de boer28-Dec-19 14:53 

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.