Say I want to initialize myArray
char myArray[MAX] = {0};
char myArray[MAX] = {0,};
char myArray[MAX]; memset(myArray, 0, MAX);
Assuming that you always want to initialize with 0.
--> Your first way and 2nd way are same. I prefer 1st.
--> Third way of memset()
should be used when you want to assign 0s other than initialization.
--> If this array is expected to initialized only once, then you can put static
keyword ahead of it, so that compiler will do the job for you (no runtime overhead)