this is what it means fifth is null terminator 065 in oct is '5' check ascii table

#include <stdio.h>

int main()
{
   char str[]="S\065AB";
   char strSame[5] = { 'S','\065', 'A', 'B', '\0'};

   printf("str 1 %d \n", sizeof(str));
   printf("str 2 %d\n", sizeof(strSame));
   printf("same ? %d [%s] [%s]",strcmp(str, strSame),str, strSame);   

   return 0;
}
Ancient Dragon commented: nice :) +14

take a look at this Click Here

use this wiki page that i gave you there is stack implementation algorithm, then post code and someone will help you

Operator precendece
maybe this will help Click Here too

alternative is malloc
you will locate it on heap instead of stack or calloc effect is same bot you haveto free it after and it can be dinamically changed during execution :)

Ancient Dragon commented: right answer :) +14

use getchar instead of fgets Click Here
your face is 2 bytes, you read 3 in it

How does this create a huge security hole and reallocating the array by 1 for each input doesn't? Keep in mind the info we have been given by the OP, not making unfounded assumptions about what we haven't been told..

maybe if you check for array overflow and realloc error then no holes

WaltP commented: Yes, if you program properly, there will be no holes. +14