0 votes 0 votes int main(int argc, char *argv[]) { int valid = 0; char str1[8] = "start"; char str2[8]; gets(str2); if (strncmp(str1, str2, 8) == 0) valid = 1; printf("buffer1: str1(%s), str2(%s), valid(%d)\n", str1, str2, valid); } Programming in C programming-in-c memory-management + – Tejeshwara asked Jun 12, 2022 edited Jun 15, 2022 by Arjun Tejeshwara 461 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply Shaik Masthan commented Jun 14, 2022 reply Follow Share Did you mean, There should be no gap between Valid variable and str1[4-7]? 0 votes 0 votes Tejeshwara commented Jun 14, 2022 reply Follow Share i am asking why is there a space ? 0 votes 0 votes Shaik Masthan commented Jun 14, 2022 reply Follow Share space means ? 0 votes 0 votes Shaik Masthan commented Jun 14, 2022 reply Follow Share Note that, when some variable declared by user, it can stored in a free space, not necessarily contiguous to previous variable allocated space. 0 votes 0 votes Please log in or register to add a comment.