Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / C
Alternative
Tip/Trick

How to zero your memory?

Rate me:
Please Sign up or sign in to vote.
4.60/5 (4 votes)
2 Aug 2011CPOL 21.2K   15
char szTest[128] = { 0 };;)
C++
char szTest[128] = { 0 };

;)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Oh yes, I will... :) Pin
Nuri Ismail9-Aug-11 3:58
Nuri Ismail9-Aug-11 3:58 
GeneralRe: Please repost testing results here. It must be interesting. Pin
Alexander Voronin9-Aug-11 3:56
Alexander Voronin9-Aug-11 3:56 
GeneralRe: 'How do you think could it be hit on performance?' Actually ... Pin
Nuri Ismail9-Aug-11 3:45
Nuri Ismail9-Aug-11 3:45 
GeneralRe: IC for now. Thanx for explanation. This behaviour also prese... Pin
Alexander Voronin9-Aug-11 3:20
Alexander Voronin9-Aug-11 3:20 
GeneralRe: Hi Alexander, It's part of C++03 Standard. For example le... Pin
Nuri Ismail9-Aug-11 3:03
Nuri Ismail9-Aug-11 3:03 
GeneralRe: Thank you very much Alok. I'm glad you like it! :) Pin
Nuri Ismail9-Aug-11 3:05
Nuri Ismail9-Aug-11 3:05 
GeneralRe: Yes, it is part of C++03. You can try it and it should work... Pin
Nuri Ismail9-Aug-11 3:08
Nuri Ismail9-Aug-11 3:08 
GeneralRe: Where did you get this? Standard (let's take this http://www... Pin
Alexander Voronin8-Aug-11 22:41
Alexander Voronin8-Aug-11 22:41 
GeneralRe: nice thing!... no votes for comment yet, otherwise my 5 for ... Pin
ThatsAlok3-Aug-11 6:33
ThatsAlok3-Aug-11 6:33 
GeneralRe: Really? ...never tried it... guess we learn something new ev... Pin
Albert Holguin3-Aug-11 4:18
professionalAlbert Holguin3-Aug-11 4:18 
Generalanyway ur tips is useful as well Pin
ThatsAlok3-Aug-11 6:32
ThatsAlok3-Aug-11 6:32 
Generalmight be i am talking about zeroing memory during data excha... Pin
ThatsAlok3-Aug-11 6:27
ThatsAlok3-Aug-11 6:27 
GeneralYes, of course. ;) Another one ? The fastet way I know: v... Pin
trotwa2-Aug-11 21:19
trotwa2-Aug-11 21:19 
GeneralReason for my vote of 4 This works too, but only for static ... Pin
Albert Holguin2-Aug-11 11:44
professionalAlbert Holguin2-Aug-11 11:44 
GeneralRe: For default initialization of dynamic sized arrays C++ provi... Pin
Nuri Ismail2-Aug-11 21:52
Nuri Ismail2-Aug-11 21:52 

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.