clear a char* string array in C

Example

#include <stdio.h>
int main()
{
    char a[100]="this is only trick";
    puts(a);

    a[0] = '\0'; // setting beginning pointer of array to null
    printf("\n");

    puts(a);

    return 0;
}

Output

this is only trick

Now this doesn’t erase all the characters in the string, but since the first character is now a termination character the string looks empty to your program.
If you want to erase all the characters in the string then you need to use a loop.