Friday , December 15 2017
Home / Tag Archives: null string

Tag Archives: null string

How to Null a string or empty a string array

Null a String/ Empty a string array Null a string in C using pointer string or array string. Many times the string is nullified assigning arr[0]=’\0′ but this will not nullify the array as only the first index will be NULL.   1. Null a string using pointer string. char *ptr="hello"; printf("%s" , ptr); *ptr='\0'; printf("\n %s  and  %s ",ptr,ptr+1); ...

Read More »