Thread: Initializing arrays to zero all in one go?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #28
    Registered User
    Join Date
    Mar 2008
    Location
    Coimbra, Portugal
    Posts
    85
    Quote Originally Posted by kmdv View Post
    Memset works byte-by-byte (rather, dword-by-dword or qword-by-qword respectively) and this is why it is _faster_. Of course, the assignment operator can work as memset either, but this is a different story.
    Ah, you're right, dword-by-dword or qword-by-qword indeed, it's faster. However, I think that we should rely on the fact that our compiler produces fast code for those operators (and it probably does).

    edit:

    Personally, I don't feel any need for memset (except raw buffer 0-ing).
    Exactly, that's what I use it for.
    Last edited by Jorl17; 09-19-2010 at 12:55 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 23
    Last Post: 12-06-2008, 01:39 PM
  2. initializing multi-dimensional arrays
    By cyberfish in forum C++ Programming
    Replies: 4
    Last Post: 10-31-2007, 08:15 PM
  3. newbee: initializing arrays
    By breaka in forum C Programming
    Replies: 11
    Last Post: 06-12-2006, 12:20 PM
  4. Initializing dynamic arrays
    By cunnus88 in forum C++ Programming
    Replies: 9
    Last Post: 11-21-2005, 09:50 AM
  5. Replies: 14
    Last Post: 03-17-2003, 10:07 AM