Question

Quick C Programming Questions: I) Which of the following is false? A) To pass a structure...

Quick C Programming Questions:

I) Which of the following is false?

A) To pass a structure by reference, pass the address of the structure variable.

B) A way to pass an array by value is to create a structure with the array as a member then pass the name of the structure.

C) To pass a structure by reference, pass the name of the structure variable.

D) Passing large structures by reference is more efficient than passing large structures by value.

II) Which of the following is false?

A)

Storage of data in memory variables is temporary; all such data is lost when a program terminates.

B)

Computers store files on primary storage devices, typically disk storage devices.

C)

Files are used for permanent retention of data (typically large amounts of data).

D)

Storage of data in memory arrays is temporary; all such data is lost when a program terminates.

III) Which of the following statements is false?

A)

Pointers should not be left uninitialized.

B)

When you use free to deallocate dynamically allocated memory, the pointer passed to free is set to NULL.

C)

Undefined behavior occurs when you attempt to use free to deallocate dynamic memory that was already deallocated

D)

Function malloc returns NULL if it's unable to allocate the requested memory.

IV) Which of the following is false?

A) Lists of data can be stored in arrays.

B) The length of a linked list can vary dynamically.

C) Arrays can become full.

D) Linked lists cannot become full.

Thank you in advanced!!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I)  To pass a structure by reference, pass the name of the structure variable.
II) Computers store files on primary storage devices, typically disk storage devices.
III)When you use free to deallocate dynamically allocated memory, the pointer passed to free is set to NULL.
IV) Linked lists cannot become full.
Add a comment
Know the answer?
Add Answer to:
Quick C Programming Questions: I) Which of the following is false? A) To pass a structure...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Fundamental Programming Question 1 (a) Consider each of the following questions carefully. You are required to...

    Fundamental Programming Question 1 (a) Consider each of the following questions carefully. You are required to give the answer true or false and justify your answer. If it is true, explain why it is true i. Linked lists are statically allocated. [2 marks] ii. Automatic variables are destroyed (deallocated) by the C++ runtime system [2 marks] i. You cannot make a reference to unallocated memory when using a vector [2 marks] iv. The virtual keyword turns off runtime checking [2...

  • C++ C++ Language 1. True/False: You can use pass by reference when passing a C++ unique...

    C++ C++ Language 1. True/False: You can use pass by reference when passing a C++ unique pointer to a function. a)True b)False 2. True/False: A temporary value in a program can be referred to by at most one lvalue reference. a)True b)False 3. A unique pointer is a pointer a that is declared in a block of code in which it is the only pointer. b that is declared in a function in which it is the only pointer. c...

  • Using C programming

    Using C, create a data file with the first number being an integer. The value of that integer will be the number of further integers which follow it in the file. Write the code to read the first number into the integer variable how_many.Please help me with the file :((This comes from this question:Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory allocation) and have it pointed to by a pointer (of type int...

  • C++ Language 1. True/False: You can use pass by reference when passing a C++ unique pointer...

    C++ Language 1. True/False: You can use pass by reference when passing a C++ unique pointer to a function. a)True b)False 2. True/False: A temporary value in a program can be referred to by at most one lvalue reference. a)True b)False 3. A unique pointer is a pointer a that is declared in a block of code in which it is the only pointer. b that is declared in a function in which it is the only pointer. c that...

  • Creating linked list data structure Overview The purpose of this assignment is for you to write...

    Creating linked list data structure Overview The purpose of this assignment is for you to write a data structure called a Linked List, which utilizes templates (similar to Java’s generics), in order to store any type of data. In addition, the nature of a Linked List will give you some experience dealing with non-contiguous memory organization. This will also give you more experience using pointers and memory management. Pointers, memory allocation, and understand how data is stored in memory will...

  • C programming The program will require the following structure: struct _data { char *name; long number;...

    C programming The program will require the following structure: struct _data { char *name; long number; }; The program will require command line arguments: int main(int argv, char **argc) { Where argv is the number of arguments and argc is an array holding the arguments (each is a string). Your program must catch any case where no command line arguement was provided and print a warning message (see below). You MUST include/use the following functions, defined as follows: int SCAN(FILE...

  • in C++, please help. Not only do we need to create an ADT but create a...

    in C++, please help. Not only do we need to create an ADT but create a main file as well to implement everything. For this program you will be creating a stack ADT to allow the client program to pick up treasures for a Star Wars scavenger game to get everyone ready for the opening of Galaxy’s Edge in 2020. Each treasure should have a (a) name, (b) description, (c) category, (d) what it is used for, and (e)if this...

  • Project Description: In this project, you will combine the work you’ve done in previous assignments to...

    Project Description: In this project, you will combine the work you’ve done in previous assignments to create a separate chaining hash table. Overview of Separate Chaining Hash Tables The purpose of a hash table is to store and retrieve an unordered set of items. A separate chaining hash table is an array of linked lists. The hash function for this project is the modulus operator item%tablesize. This is similar to the simple array hash table from lab 5. However, the...

  • Program Overview This brief exercise is designed for you to consider how reference variables behave when...

    Program Overview This brief exercise is designed for you to consider how reference variables behave when you are passing them as arguments by-value. Instructions Name your class References.java. 1. Implement the following methods. 1.1 Method name: readStudentNames Purpose: This method accepts an array of strings as a parameter. It loops through the array and asks the user to input names. It populates the array of strings with the names. Parameters: an array of Strings, stringArray Return type: void In the...

  • complete in C++ code Lists Many programming languages have some kind list data structure, which allows...

    complete in C++ code Lists Many programming languages have some kind list data structure, which allows for insertion and deletion of elements, essentially an array that changes size. C++ has vectors, Java has the ArrayList, Python has lists (which is what they're called generically anyway). But how do they really work? All of these actually use arrays, which naturally have immutable lengths. Your Task Your task is to write a function, insert, which inserts a new item into an existing...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT