Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Richard MacCutchan20-Dec-18 6:06
mveRichard MacCutchan20-Dec-18 6:06 
AnswerRe: PostMessage fails with ERROR_NOT_ENOUGH_QUOTA Pin
Randor 19-Dec-18 14:32
professional Randor 19-Dec-18 14:32 
QuestionMacro analysis - help wanted Pin
Vaclav_18-Dec-18 3:43
Vaclav_18-Dec-18 3:43 
AnswerRe: Macro analysis - help wanted Pin
leon de boer18-Dec-18 6:03
leon de boer18-Dec-18 6:03 
GeneralRe: Macro analysis - help wanted Pin
Vaclav_18-Dec-18 6:44
Vaclav_18-Dec-18 6:44 
GeneralRe: Macro analysis - help wanted Pin
leon de boer18-Dec-18 7:47
leon de boer18-Dec-18 7:47 
GeneralRe: Macro analysis - help wanted Pin
Vaclav_18-Dec-18 13:30
Vaclav_18-Dec-18 13:30 
SuggestionRe: Macro analysis - help wanted Pin
David Crow18-Dec-18 10:04
David Crow18-Dec-18 10:04 
GeneralRe: Macro analysis - help wanted Pin
Vaclav_18-Dec-18 13:32
Vaclav_18-Dec-18 13:32 
QuestionPlacing the dialog bar Pin
manoharbalu17-Dec-18 23:12
manoharbalu17-Dec-18 23:12 
AnswerRe: Placing the dialog bar Pin
Richard MacCutchan17-Dec-18 23:48
mveRichard MacCutchan17-Dec-18 23:48 
GeneralRe: Placing the dialog bar Pin
manoharbalu18-Dec-18 1:42
manoharbalu18-Dec-18 1:42 
GeneralRe: Placing the dialog bar Pin
Richard MacCutchan18-Dec-18 1:54
mveRichard MacCutchan18-Dec-18 1:54 
GeneralRe: Placing the dialog bar Pin
manoharbalu18-Dec-18 1:59
manoharbalu18-Dec-18 1:59 
QuestionRe: Placing the dialog bar Pin
David Crow18-Dec-18 4:19
David Crow18-Dec-18 4:19 
GeneralRe: Placing the dialog bar Pin
Richard MacCutchan18-Dec-18 4:49
mveRichard MacCutchan18-Dec-18 4:49 
GeneralRe: Placing the dialog bar Pin
Richard MacCutchan18-Dec-18 6:28
mveRichard MacCutchan18-Dec-18 6:28 
GeneralRe: Placing the dialog bar Pin
manoharbalu18-Dec-18 22:55
manoharbalu18-Dec-18 22:55 
GeneralRe: Placing the dialog bar Pin
mo149219-Dec-18 0:18
mo149219-Dec-18 0:18 
GeneralRe: Placing the dialog bar Pin
mo149219-Dec-18 1:44
mo149219-Dec-18 1:44 
GeneralRe: Placing the dialog bar Pin
manoharbalu20-Dec-18 2:01
manoharbalu20-Dec-18 2:01 
GeneralRe: Placing the dialog bar Pin
mo149220-Dec-18 12:31
mo149220-Dec-18 12:31 
GeneralRe: Placing the dialog bar Pin
manoharbalu20-Dec-18 17:40
manoharbalu20-Dec-18 17:40 
GeneralRe: Placing the dialog bar Pin
Richard MacCutchan19-Dec-18 4:20
mveRichard MacCutchan19-Dec-18 4:20 
QuestionPassing / modifying char* to/ by function. Pin
Vaclav_16-Dec-18 16:33
Vaclav_16-Dec-18 16:33 
My task is to make a function to append int to char*, using C style and end up with char*. No string etc.
I have it partially figured out - see attached code.
I have some understanding how passing by value works, but not sure how to actually code / use the strcat - the "all concatenated / done " part and use it in main code.


C++
<pre>
char * CLASS_LCM1602::BuildMessage(char *&title, int value) {

	// convert int to char
	char buffer[100];
	snprintf(buffer, sizeof(buffer), "%d", value);
#ifdef DEBUG
	cout << " conversion int to char buffer " << +buffer << endl; //TOK 
#endif

	char FullMessage[100];
	// why is this needed ?? strcat won't execute without strcpy first
	strcpy(FullMessage, title);
	cout << "title copy " << FullMessage << endl;
	//append buffer
	strcat(FullMessage, buffer);
	cout << "full message " << FullMessage << endl; // TOK 

this is where I need some help 
this does not makes sense to me 
it compiles , does not execute 

 	strcpy(title, FullMessage);
	cout << "title " << title << endl;

	exit(1);  // temp exit 

	return FullMessage;  // return not used , need to compile 
}


The function call

C++
<pre>	
        char *title = "NEW TEST";
	int  value  = 100;
	char *message = i2c.BuildMessage(title, value); // message not used for now 

here is the desired result code 
never gets here 	

	cout << " pass full message "<< +title << endl;

#endif


Any ( factual ) help will be appreciated.

Cheers
Vaclav

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.