News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Clearing a string in C

Started by Robert Collins, November 03, 2005, 04:42:41 PM

Previous topic - Next topic

Robert Collins

How do I clear a string in C?

A string in my C program contains data from a previous operation. Now I want to use that same string again for new data. I tried the following....

MyString[MAX_CHARS] = NULL;

....but the string still holds the previous data.

hutch--

Robert,

If its a zero terminated string buffer, just write an ascii zero to the first byte in the buffer.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php