Question: undefined QUESTION 7 Consider this code fragment which is trying to build a string by hand: char buff[3]; buff[1] = 'x'; buff[2] = 'y'; buff[3]

undefined QUESTION 7 Consider this code fragment which is trying to builda string by hand: char buff[3]; buff[1] = 'x'; buff[2] = 'y';buff[3] = 'z'; 0 000 Are there any problems with this code?undefined

QUESTION 7 Consider this code fragment which is trying to build a string by hand: char buff[3]; buff[1] = 'x'; buff[2] = 'y'; buff[3] = 'z'; 0 000 Are there any problems with this code? Check all that apply The data type is incorrect There is a buffer overflow The string is not NULL-terminated The first array entry is not initialized. QUESTION 5 Consider the following code: O O O O O char buff [100]; printf ("Enter word: "); scanf("%s", buff); We want to test if the user entered the word Hello. This of the following code fragments is correct? O if (buff.equals("Hello")) { ... } if (buff = "Hello") { ... } if (strcmp(buff, "Hello") == 0) { ... } if (strcmp(buff, "Hello")) { ... } if (buff == "Hello") { ... } QUESTION 8 Consider this code: y; }; struct pair { int x, struct pair z; void func() { struct pair y; struct pair *x = (struct pair *) malloc(sizeof(struct pair)); } Match each of the variables with the memory segment it is assigned. Az A. heap memory B. stack memory 4 x C. global memory

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!