Sokurenko 42 Junior Poster

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
Sokurenko 42 Junior Poster

take a look at this Click Here

Sokurenko 42 Junior Poster

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

Sokurenko 42 Junior Poster

Operator precendece
maybe this will help Click Here too

Sokurenko 42 Junior Poster

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
Sokurenko 42 Junior Poster

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

Sokurenko 42 Junior Poster

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