Click here to Skip to main content
15,889,116 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MS developer Pin
Chris Meech30-Nov-10 6:08
Chris Meech30-Nov-10 6:08 
GeneralRe: MS developer Pin
CPallini30-Nov-10 7:12
mveCPallini30-Nov-10 7:12 
AnswerRe: MS developer Pin
danandu1-Dec-10 19:52
danandu1-Dec-10 19:52 
QuestionRe: MS developer Pin
CPallini1-Dec-10 21:01
mveCPallini1-Dec-10 21:01 
AnswerRe: MS developer Pin
danandu1-Dec-10 23:00
danandu1-Dec-10 23:00 
QuestionHow to write SQL predicate FREETEXT in String query in MFC? Pin
MahaKh29-Nov-10 18:08
MahaKh29-Nov-10 18:08 
QuestionChar* not maintaing correct assigned Values Pin
jcp121729-Nov-10 17:36
jcp121729-Nov-10 17:36 
AnswerRe: Char* not maintaing correct assigned Values Pin
Luc Pattyn29-Nov-10 17:45
sitebuilderLuc Pattyn29-Nov-10 17:45 
Hi,

output is a pointer, you make it point to a string literal ("fooOutput").

testString is not a pointer, it is a 32-character buffer; it can be used like a pointer, however it cannot be changed, it will always point to that buffer.

The solution to this discrepancy depends on what you want:
1. maybe you want Foo to stuff its data into whatever buffer you pass it; you then need strcpy() or something similar, not a simple assignment.
2. maybe you want main to hold a pointer, then you need to declare char* testString; however that would still not be sufficient as the pointer gets passed by value, i.e. Foo can read it, but whatever it writes to the pointer won't alter the pointer in Main. To solve that, you either need an extra indirection (a second asterisk), or simply use the return value instead of a parameter.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


QuestionHow to read .txt file and find delimiter ? Pin
mathivanaan29-Nov-10 17:22
mathivanaan29-Nov-10 17:22 
AnswerRe: How to read .txt file and find delimiter ? Pin
Luc Pattyn29-Nov-10 17:49
sitebuilderLuc Pattyn29-Nov-10 17:49 
AnswerRe: How to read .txt file and find delimiter ? Pin
Adam Roderick J29-Nov-10 18:00
Adam Roderick J29-Nov-10 18:00 
QuestionRe: How to read .txt file and find delimiter ? Pin
David Crow30-Nov-10 5:11
David Crow30-Nov-10 5:11 
QuestionUser Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
Paul Belikian29-Nov-10 17:02
Paul Belikian29-Nov-10 17:02 
AnswerRe: User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
Luc Pattyn29-Nov-10 17:50
sitebuilderLuc Pattyn29-Nov-10 17:50 
GeneralRe: User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
Paul Belikian29-Nov-10 18:21
Paul Belikian29-Nov-10 18:21 
AnswerRe: User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
David Crow30-Nov-10 5:14
David Crow30-Nov-10 5:14 
GeneralRe: User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
Paul Belikian30-Nov-10 10:19
Paul Belikian30-Nov-10 10:19 
GeneralRe: User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
Roger Allen1-Dec-10 5:44
Roger Allen1-Dec-10 5:44 
GeneralRe: User Button Notification Codes: BN_CLICKED, is there a way to get notification when it is unclicked? Pin
Paul Belikian1-Dec-10 7:10
Paul Belikian1-Dec-10 7:10 
QuestionSave as HTML to text file Pin
Max++29-Nov-10 16:36
Max++29-Nov-10 16:36 
AnswerRe: Save as HTML to text file Pin
visualheadsky29-Nov-10 17:14
visualheadsky29-Nov-10 17:14 
QuestionSpin control , it's possible to know when the control is released? Pin
timbk29-Nov-10 16:05
timbk29-Nov-10 16:05 
AnswerRe: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 1:56
Code-o-mat30-Nov-10 1:56 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
timbk30-Nov-10 8:33
timbk30-Nov-10 8:33 
GeneralRe: Spin control , it's possible to know when the control is released? Pin
Code-o-mat30-Nov-10 8:43
Code-o-mat30-Nov-10 8:43 

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.