Click here to Skip to main content
16,019,105 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Class Shape Pin
kumn1d25-Jul-17 8:52
kumn1d25-Jul-17 8:52 
QuestionRe: Class Shape Pin
David Crow25-Jul-17 2:23
David Crow25-Jul-17 2:23 
AnswerRe: Class Shape Pin
kumn1d25-Jul-17 8:51
kumn1d25-Jul-17 8:51 
QuestionRe: Class Shape Pin
David Crow25-Jul-17 10:15
David Crow25-Jul-17 10:15 
SuggestionEducational: my buffer scroll C++ working code. Pin
Member 132416522-Jul-17 0:31
Member 132416522-Jul-17 0:31 
GeneralRe: Educational: my buffer scroll C++ working code. Pin
Richard MacCutchan22-Jul-17 0:57
mveRichard MacCutchan22-Jul-17 0:57 
GeneralRe: Educational: my buffer scroll C++ working code. Pin
Member 132416522-Jul-17 5:19
Member 132416522-Jul-17 5:19 
GeneralRe: Educational: my buffer scroll C++ working code. Pin
leon de boer22-Jul-17 1:14
leon de boer22-Jul-17 1:14 
yes it belongs in tips but I also have a little tip for you.
memmove from the C/C++ standards library can deal with source and destination memory overlapping and it can do it with no extra buffers at all.
So you really only need the string search parts of your code and then use memmove to do the shuffle replacing the memcpy's

memmove[^]
memmove ensures that the original source bytes in the overlapping region are copied before being overwritten.

It was probably a good learning excercise and you can rate how you went against a standards library and here is the code
public source Implementation of memcopy[^]

It's never wasted time to learn the standards libraries Smile | :)
In vino veritas


modified 22-Jul-17 7:22am.

GeneralRe: Educational: my buffer scroll C++ working code. Pin
Member 132416522-Jul-17 5:09
Member 132416522-Jul-17 5:09 
QuestionCN Pin
Member 1332222821-Jul-17 7:58
Member 1332222821-Jul-17 7:58 
AnswerRe: CN Pin
Afzaal Ahmad Zeeshan21-Jul-17 9:12
professionalAfzaal Ahmad Zeeshan21-Jul-17 9:12 
AnswerRe: CN Pin
jeron121-Jul-17 9:34
jeron121-Jul-17 9:34 
AnswerRe: CN Pin
David Crow21-Jul-17 10:30
David Crow21-Jul-17 10:30 
QuestionDoes CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
ForNow20-Jul-17 15:55
ForNow20-Jul-17 15:55 
AnswerRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Richard MacCutchan20-Jul-17 20:34
mveRichard MacCutchan20-Jul-17 20:34 
AnswerRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Jochen Arndt20-Jul-17 21:00
professionalJochen Arndt20-Jul-17 21:00 
GeneralRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
ForNow21-Jul-17 3:05
ForNow21-Jul-17 3:05 
GeneralRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Richard MacCutchan21-Jul-17 3:24
mveRichard MacCutchan21-Jul-17 3:24 
GeneralRe: Does CString;;GetBufferSetLength Set/Allocate the CString Buffer Pin
Jochen Arndt21-Jul-17 3:35
professionalJochen Arndt21-Jul-17 3:35 
Question《programming game AI by example》 Pin
bestbear19-Jul-17 20:11
bestbear19-Jul-17 20:11 
AnswerRe: 《programming game AI by example》 Pin
leon de boer19-Jul-17 20:51
leon de boer19-Jul-17 20:51 
GeneralRe: 《programming game AI by example》 Pin
bestbear21-Jul-17 2:12
bestbear21-Jul-17 2:12 
QuestionHelp with Heap Corruption "Critical error detected c0000374" Pin
ForNow19-Jul-17 13:47
ForNow19-Jul-17 13:47 
AnswerRe: Help with Heap Corruption "Critical error detected c0000374" Pin
leon de boer19-Jul-17 20:16
leon de boer19-Jul-17 20:16 
GeneralRe: Help with Heap Corruption "Critical error detected c0000374" Pin
ForNow19-Jul-17 21:42
ForNow19-Jul-17 21:42 

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.