Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You can assume the code given is from working code. Answer the true/false questions that follow. You MUST explain why your answer is true or

You can assume the code given is from working code. Answer the true/false questions that follow. You MUST explain why your answer is true or false to receive credit.

char present_num(int **all_nums, int size, int num_to_find)

{

char answer='n'; int i; for(i=0;i

if(**all_nums==num_to_find) {

answer='y'; }

all_nums++; }

return answer;

}

int same_stuff(int* x_arr[]) {

if(*x_arr[0]==*x_arr[1]) {

return 1; }

else {

return 0; }

}

  1. Only one type of unary operator is used in the code.

  2. sizeof(x_arr[0])==sizeof(*x_arr[0])

  3. sizeof(x_arr)==sizeof(all_nums)

  1. The for loop will not always iterate the same number of times.

  2. all_nums++; will move the pointer ahead 4 bytes (the size of an int on my machine).

  3. The function same_stuff will return 1 if the values held in index 0 and 1 of x_arr are equal.

  4. num_to_find=**all_nums; would be a valid line of code.

  5. same_stuff will return 0 for all cases except for one.

  6. If the value of num_to_find is found to match an element of all_nums, the value of answer will be y.

10. int* ptr= *x_arr[0]; would be a valid line of code.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago