Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CSocket: using thread or not? Pin
includeh1012-Aug-09 8:14
includeh1012-Aug-09 8:14 
GeneralRe: CSocket: using thread or not? Pin
Rajesh R Subramanian12-Aug-09 9:36
professionalRajesh R Subramanian12-Aug-09 9:36 
AnswerRe: CSocket: using thread or not? Pin
Bacon Ultimate Cheeseburger12-Aug-09 17:17
Bacon Ultimate Cheeseburger12-Aug-09 17:17 
GeneralRe: CSocket: using thread or not? Pin
wmallory13-Aug-09 5:12
wmallory13-Aug-09 5:12 
GeneralRe: CSocket: using thread or not? Pin
Bacon Ultimate Cheeseburger13-Aug-09 11:23
Bacon Ultimate Cheeseburger13-Aug-09 11:23 
GeneralRe: CSocket: using thread or not? Pin
wmallory14-Aug-09 5:12
wmallory14-Aug-09 5:12 
AnswerRe: CSocket: using thread or not? Pin
Moak13-Aug-09 13:20
Moak13-Aug-09 13:20 
QuestionFastest way to copy memory Pin
paolosh12-Aug-09 6:09
paolosh12-Aug-09 6:09 
Hi all,

I'm in the process of writing my own Matrix Library, and have been using the standard way to copy things around, i.e. if i have a pointer to a bunch of doubles, say

T * my_doubles = new T[64];

representing an 8 by 8 array, then if i want a copy constructor of a class to duplicate this then i just issue the following code in the copy constructor:

for(unsigned int count = 0; count < 64; count++)
new_doubles[count] = my_doubles[count];

however, i have been reading around on the net that there are faster ways to copy memory, mainly using memcpy. i have also learned that some people are against the use of this because the compiler optimizes code such as that above to be the most efficient.

so what's it to be?... regarding SPEED, is it really best to let the compiler optimize, or use memcpy, or some other method?... and if so what are these methods?

Many thanks,
Paul
QuestionRe: Fastest way to copy memory PinPopular
CPallini12-Aug-09 6:26
mveCPallini12-Aug-09 6:26 
JokeRe: Fastest way to copy memory Pin
Rajesh R Subramanian12-Aug-09 7:44
professionalRajesh R Subramanian12-Aug-09 7:44 
GeneralRe: Fastest way to copy memory Pin
CPallini12-Aug-09 9:07
mveCPallini12-Aug-09 9:07 
GeneralRe: Fastest way to copy memory Pin
paolosh12-Aug-09 9:09
paolosh12-Aug-09 9:09 
GeneralRe: Fastest way to copy memory Pin
Rajesh R Subramanian12-Aug-09 9:30
professionalRajesh R Subramanian12-Aug-09 9:30 
GeneralRe: Fastest way to copy memory Pin
CPallini12-Aug-09 9:46
mveCPallini12-Aug-09 9:46 
GeneralRe: Fastest way to copy memory Pin
paolosh12-Aug-09 9:54
paolosh12-Aug-09 9:54 
GeneralRe: Fastest way to copy memory Pin
CPallini12-Aug-09 9:36
mveCPallini12-Aug-09 9:36 
GeneralRe: Fastest way to copy memory Pin
paolosh12-Aug-09 9:56
paolosh12-Aug-09 9:56 
GeneralRe: Fastest way to copy memory Pin
Randor 12-Aug-09 9:15
professional Randor 12-Aug-09 9:15 
GeneralRe: Fastest way to copy memory Pin
Rajesh R Subramanian12-Aug-09 9:44
professionalRajesh R Subramanian12-Aug-09 9:44 
AnswerRe: Fastest way to copy memory Pin
includeh1012-Aug-09 8:24
includeh1012-Aug-09 8:24 
GeneralRe: Fastest way to copy memory Pin
paolosh12-Aug-09 9:10
paolosh12-Aug-09 9:10 
GeneralRe: Fastest way to copy memory Pin
Luc Pattyn12-Aug-09 9:52
sitebuilderLuc Pattyn12-Aug-09 9:52 
AnswerRe: Fastest way to copy memory Pin
Joe Woodbury12-Aug-09 9:29
professionalJoe Woodbury12-Aug-09 9:29 
AnswerRe: Fastest way to copy memory Pin
Rajesh R Subramanian12-Aug-09 9:41
professionalRajesh R Subramanian12-Aug-09 9:41 
GeneralRe: Fastest way to copy memory Pin
Bacon Ultimate Cheeseburger12-Aug-09 17:44
Bacon Ultimate Cheeseburger12-Aug-09 17:44 

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.