Most of the time, myarray is just a character array, so I fill it full of null characters. However, is there a better way to do this? (It almost seems this is more suited to clearing structures or objects.)
Should I be using a string function? Or, should I use strlen() instead of sizeof()?
Or, at the very least is memset any more or any less efficient that a standard for loop to clear an array? I ask this because I might want to set myarray to a value other than null within the program.
Thanks in advance!
Edit: And yes, performance is quite important for my application.
Cjam 2.5.0.0 by Razvan Serea
Cjam is a lightweight and fast MP3 editor for Windows that lets you cut, join, and edit MP3 files without re-encoding. This means your audio quality remains untouched, and edits happen instantly. Cjam is ideal for quick, lossless edits—whether you're trimming music, combining tracks, or preparing audio for learning tools or podcasts.
It features batch processing, scripting support, cue and playlist file handling, and a simple interface. Cjam is perfect for anyone who needs efficient MP3 editing without the complexity of full audio suites.
Cjam requires a PC running Windows 10 or later and Microsoft .NET 6.0 or later.
Key features for Cjam:
No Re-encoding: Edit MP3 files without losing quality.
Cut and Join MP3: Easily cut, trim, and combine MP3 tracks.
Batch Processing: Edit multiple files at once for faster workflows.
Scriptable Interface: Automate tasks with a custom command language.
Cue and Playlist Support: Handle CUE and playlist files for seamless audio management.
Fast and Lightweight: Quick processing with minimal system resources.
Lossless Audio Editing: Ensure your edits don't affect audio quality.
Simple User Interface: Clean, intuitive design for easy navigation.
File Format Support: Works with MP3, Cjam-specific file formats (CJAMC, CJAMJ, CJAM).
Cjam 2.5.0.0 changelog:
Added clipboard-based import/export support for mp3DirectCut
Added clipboard-based export support for REAPER
Added support for naming IMP3 elements
Changed the Reset behavior to preserve Undo/Redo history; use Shift key + Reset button to clear it
Added a new command parameter (qcp)
Added 8 new entries to lang.txt (main_c124-126, main_d150-151, main_m082, vme_c014, vme_d005)
Fixed a bug where the il parameter was incorrectly applied when pasting VMP3s into the main list
Fixed several other minor bugs
Download: Cjam 2.5.0.0 | 1.4 MB (Freeware)
Links: Cjam Home Page | Cjam Manual | Screenshot
Get alerted to all of our Software updates on Twitter at @NeowinSoftware
WTF! Nah, not this one.
If you were back then using computers in the 90s or you had a clue, you'd know this was huge and was seen and overused absolutely everywhere and you'd take this article as no more than a retrospective story. That's all it is.
these "editors" get paid by the amount of articles and not the quality of content; hence why we get this random stuff from the same "editor" time and time again.
Question
A4B4
So far I've been using:
memset(myarray, 0, sizeof(myarray));
Most of the time, myarray is just a character array, so I fill it full of null characters. However, is there a better way to do this? (It almost seems this is more suited to clearing structures or objects.)
Should I be using a string function? Or, should I use strlen() instead of sizeof()?
Or, at the very least is memset any more or any less efficient that a standard for loop to clear an array? I ask this because I might want to set myarray to a value other than null within the program.
Thanks in advance!
Edit: And yes, performance is quite important for my application.
Link to comment
https://www.neowin.net/forum/topic/624316-cc-what-is-the-quickestmost-efficient-way-to-clear-an-array/Share on other sites
10 answers to this question
Recommended Posts