Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

STATS 108-A General Utilities - 3 PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS! I WANT THIS IN 5MINS. BECAUSE DUE DATE IS HERE.

STATS 108-A

"General Utilities - 3"

PLEASE SKIP THIS IF YOU CANT FINISH IN 5MINS!

I WANT THIS IN 5MINS. BECAUSE DUE DATE IS HERE. THANKS

I WILL REPORT THOSE WHO WILL FLAG THIS!

READ COMMENTS FOR INSTRUCTIONS

6. Which of the given statement is true with respect to the function atexit()?

a) The atexit() function cannot return to its caller

b) The atexit() function is used to return zero if the registration succeeds, nonzero if it fails

c) The atexit() function returns no value

d) The atexit() function causes abnormal program termination to occur

7. The behavior is undefined if more than one call to the exit function is executed by a program.

a) true

b) false

8. Which function searches an environmenr list that are provided by the host environment?

a) getenv()

b) system()

c) srand()

d) rand()

9. The system() function passes the string pointed to by string to the host environment to be executed by a command processor in an implementation-defined manner.

int system(const char *string); 

a) true

b) false

10. What will be the output of the following C code?

int main(void) { int rc; rc = system("time"); exit(0); } 

a) produces error

b) no value is returned

c) returns the time

d) nothing can be said

1. void free(void *ptr) deallocates the memory previously allocated by a call to _______ ________ or _________

a) malloc,getenv,abort

b) calloc,malloc,exit

c) calloc,malloc,realloc

d) exit,getenv,abort

2. The ________ function returns no value.

a) malloc()

b) realloc()

c) free()

d) calloc()

3. What is returned by the function if the space cannot be allocated by the function malloc(), realloc() and calloc()?

a) value

b) error

c) null pointer

d) no value

4. What is the function of the void *realloc(void *str, size-t size);?

a) allocates space for an array of str objects, each of whose size is size

b) allocates space for an object whose size is specified by size and whose value is indeterminate

c) changes the size of the object pointed to by str to the size specified by size

d) causes the space pointed to by str to be deallocated, that is, made available for further allocation

5. Which among the given function causes abnormal program termination ?

a) exit()

b) abort()

c) atexit()

d) getenv()

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

More Books

Students also viewed these Mathematics questions

Question

2. Be sure to make eye contact with the students.

Answered: 1 week ago

Question

5. How can I help others in the network achieve their goals?

Answered: 1 week ago