Is a struct stored on the heap or stack? 

1 Answer

Answer :

Stack

Related questions

Description : What is a heap and a stack?

Last Answer : There are 2 kinds of heap - 1: a chunk of memory where data is stored and 2: a tree based data structure. When we talk about the heap and the stack we mean the first kind of ... a LIFO data structure that stores variables and flow control information. Typically each thread will have its own stack.

Description : What is the difference between a Struct and a Class? 

Last Answer : Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.

Description : Can you derive from a struct? 

Last Answer : No

Description : Can a struct have methods?

Last Answer : Yes

Description : What is a struct?

Last Answer : Unlike in C++ a struct is not a class – it is a value type with certain restrictions. It is usually best to use a struct to represent simple entities with a few variables. Like a Point for example which contains variables x and y.

Description : What is the default accessibility for members of a struct? 

Last Answer : private

Description : What is the difference between a Struct and a Class?

Last Answer : Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.

Description : Can a class or a struct have multiple constructors?

Last Answer : Yes, a class or a struct can have multiple constructors. Constructors in C# can be overloaded.

Description : What is the difference between the stack and the heap?

Last Answer : The stack is a local memory reserve where the program stores variable and function data. The heap is a special memory reserve where the programmer can dynamically allocate memory from. The heap is useful ... large to make certain variables, he just constructs one of the right size during run-time.

Description : In UNIX operating system, when a process creates a new process using the fork() system call, which of the following state is shared between the parent process and child process? (A) Heap (B) Stack (C) Shared memory segments (D) Both Heap and Stack

Last Answer : (C) Shared memory segments 

Description : Match the following types of variables with the corresponding programming languages: (a) Static variables (i) Local variables in Pascal (b) Stack dynamic (ii) All variables in APL (c) Explicit heap dynamic (iii) Fortran 77 (d) Implicit ... (ii) (C) (iii) (i) (iv) (ii) (D) (ii) (i) (iii) (iv)

Last Answer : (C) (iii) (i) (iv) (ii) 

Description : Given part of a stack trace: aspnet.debugging.BadForm.Page_Load(Object sender, EventArgs e) +34. What does the +34 mean?

Last Answer : It is an actual offset (at the assembly language level) – not an offset into the IL instructions. 

Description : Safe condition for storage of high V.M. bituminous coal is that (A) Height of the coal heap should be < 3 metres (B) Maximum 200 tons should be stored in a heap (C) Both (A) and (B) (D) Neither (A) nor (B)

Last Answer : (C) Both (A) and (B)

Description : What is the lifespan for items stored in ViewState? Select Answer:  1. Item stored in ViewState exist for the life of the current page  2. Item stored in ViewState exist for the life ... of the current Applicaiton  4. Item stored in ViewState exist for the life of the current configuration

Last Answer : 1. Item stored in ViewState exist for the life of the current page AS any web application works on request and response basis ,so on every post backs, The data in control gets lost. To retain page ... control with data. The life cycle of the view state exist for life of current running page only. 

Description : Where are shared assemblies stored ?

Last Answer : Answer: Global assembly cache.

Description : Where are shared assemblies stored?

Last Answer : The GAC  

Description : Where are private assemblies stored? 

Last Answer : Same folder as exe 

Description : If an integer occupies 4 bytes and a character occupies 1 byte of memory, each element of the following structure would occupy how many bytes ? struct name { int age; char name[30]; }; A) 30 B) 32 C) 34 D) 36

Last Answer : C) 34

Description : How the buckets are stored in predicate indexing? a) Lists b) Stack c) Hashes d) None of the mentioned

Last Answer : c) Hashes

Description : When subroutine is called contents of program counter is location address of __ instruction following call instruction is stored on _ __and program execution is transferred to __ address. a. Non ... , Stack and Main program Cc. Executable, Queue and Subroutine d. Executable, Stack and Subroutine

Last Answer : d. Executable, Stack and Subroutine

Description : Opcode is the machine instruction obtained from decoding instruction stored in. a. Stack pointer b. Address pointer Cc. Instruction register d. Incrementer

Last Answer : Cc. Instruction register

Description : In microprocessor the next instruction to be executed is stored in a) Program Counter b) Stack Pointer c) Memory Pointer d) Accumulator

Last Answer : Ans: Program Counter

Description : When the RET instruction at the end of subroutine is executed, a. the information where the stack is iniatialized is transferred to the stack pointer b. the memory address of the RET instruction is ... two data bytes stored in the top two locations of the stack are transferred to the stack pointer

Last Answer : c. two data bytes stored in the top two locations of the stack are transferred to the program counter

Description : When a subroutine is called, the address of the instruction following the CALL instructions stored in/on the a. stack pointer b. accumulator c. program counter d. stack

Last Answer : d. stack

Description : A stack pointer is a. a 16-bit register in the microprocessor that indicate the beginning of the stack memory. b. a register that decodes and executes 16-bit arithmetic expression. c. The first memory location where a subroutine address is stored. d. a register in which flag bits are stored

Last Answer : a. a 16-bit register in the microprocessor that indicate the beginning of the stack memory.

Description : The processor uses the stack to keep track of where the items are stored on it this by using the: a. Stack pointer register b. Queue pointer register c. Both a & b d. None of these

Last Answer : a. Stack pointer register

Description : ………… is very useful in situation when data have to stored and then retrieved in reverse order. A) Stack B) Queue C) List D) Link list

Last Answer : A) Stack

Description : Can you dispose of paper in a compost heap?

Last Answer : There’s chemicals used in paper manufacturing; bleaches and dyes and so forth, that can leech into the compost, I’d imagine. I wouldn’t put paper in the compost, no.

Description : Does anyone know how to build a compost heap?

Last Answer : This link has a pretty good explanation as to how to do so.

Description : A heap of wheat is in the form of a cone whose diameter is 10.5 m and height is 3 m. -Maths 9th

Last Answer : Diameter of cone = 10.5 m Radius of cone (r) = 5.25 m Height of cone (h) = 3 m Volume of cone = 1 / 3 πr2h = 1 / 3 × 22 / 7 × 5.25 × 5.25 × 3 = 86.625m3 Cost of 1m3 of wheat = 10 ∴ Cost of 86.625 m3 of wheat = 10 × 86.625 = 86.625

Description : A heap of wheat is in the form of a cone whose diameter is 10.5 m and height is 3 m. -Maths 9th

Last Answer : Diameter of cone = 10.5 m Radius of cone (r) = 5.25 m Height of cone (h) = 3 m Volume of cone = 1 / 3 πr2h = 1 / 3 × 22 / 7 × 5.25 × 5.25 × 3 = 86.625m3 Cost of 1m3 of wheat = 10 ∴ Cost of 86.625 m3 of wheat = 10 × 86.625 = 86.625

Description : A heap of wheat is in the form of a cone whose diameter is 10.5 m -Maths 9th

Last Answer : Radius of the conical heap of wheat (r) = 10.5/2 m Height of the conical heap of wheat (h) = 3 m Volume of the conical heap of wheat = 1/3 πr2h = 1/3 x 22/7 x (10.5/2)2 x 3 = 173.25/2 = 86.625 ... = 6.05 m Area of canvas required = curved surface area of cone πrl = 22/7 x 10.5/2 x 6.05 = 99.825 m2

Description : what is a heap

Last Answer : Need Answer

Description : When Marrion divided 24 oranges into 3 heaps in the ratio 4 to 5 to 3 how many oranges were in each heap?

Last Answer : There are 8, 10 and 6.

Description : What is the collective noun heap?

Last Answer : The noun 'heap' is used as a collective noun for: a heap oftrash.

Description : The layers of vegetable wastes and night soil alternatively piled above the ground to form a mound, is called A. A heap B. Plateau C. Windrow D. None of these

Last Answer : ANS: D

Description : Define what are the advantages and disadvantages of a heap?

Last Answer : Storing data on the heap is slower than it would take when using the stack. Define, However, the main advantage of using the heap is its flexibility. That's because the memory in this ... particular order. Slowness in the heap can be compensated if an algorithm was well designed and implemented.

Description : Which of the following is not the internal sort? A) Insertion Sort B) Bubble Sort C) Merge Sort D) Heap Sort

Last Answer : C) Merge Sort

Description : Which of the following algorithms has lowest worst case time complexity? a) Insertion sort b) Selection sort c) Quick sort d) Heap sort

Last Answer : d) Heap sort

Description : Consider the situation in which assignment operation is very costly. Which of the following sorting algorithm should be performed so that the number of assignment operations is minimized in general? a) Insertion sort b) Selection sort c) Heap sort d) None

Last Answer : b) Selection sort

Description : Which of the following is not an in-place sorting algorithm? a) Selection sort b) Heap sort c) Quick sort d) Merge sort

Last Answer : merge sort

Description : Which of the following is a stable sorting algorithm? a) Merge sort b) Typical in-place quick sort c) Heap sort d) Selection sort

Last Answer : a) Merge sort

Description : Which one of the following array represents a binary max-heap? (A) [26, 13, 17, 14, 11, 9, 15] (B) [26, 15, 14, 17, 11, 9, 13] (C) [26, 15, 17, 14, 11, 9, 13] (D) [26, 15, 13, 14, 11, 9, 17]

Last Answer : (C) [26, 15, 17, 14, 11, 9, 13]

Description : Heap allocation is required for languages  A) That support recursion B) That support dynamic data structures C) That use dynamic scope rules D) None of the above

Last Answer : Heap allocation is required for languages That support dynamic data structures

Description : What si the difference between interface and abstractclass Select Answer:  1. interface contain only methods  2. we can't declare a variable for interface  3. interface contain only events  4. None  5. All

Last Answer : Ans : 2 The only Difference between Interface and Abstract class is we can declare a variable in abstract class but we can't declare in variable interface

Description : Which one of the following tools is used to view the metadata information contained in a .NET assembly? Select Answer:  1. al.exe  2. ilasm.exe  3. vbx.exe  4. csc.exe  5. ildasm.exe

Last Answer :  5. ildasm.exe

Description : How would you ensure that all relevant registry entries were removed in the event that installation of your application failed?

Last Answer : You can ensure that registry entries are removed, as well as perform any other “clean-up” tasks, by creating an Installer class and writing the appropriate code in the Rollback event handler. Then create a new Custom Action and set the InstallerClass, and EntryPoint properties to appropriate values.

Description : Describe a general strategy for creating a setup project that terminates installation if a specific file is not already installed on the target machine.

Last Answer : First, create a file search to search the file system for the specific file. Then create a launch condition to evaluate the results of the search. You can connect the launch condition to ... in the search's Property property in the expression specified by the launch condition's Condition property. 

Description : What is the purpose of a bootstrapper application? When do you not need to create one?

Last Answer : A bootstrapper application automatically detects if Windows Installer is installed on the target machine. If Windows Installer is not present, it installs Windows Installer before proceeding with the rest ... Installer 1.5 already installed) or have had Microsoft Installer 1.5 installed previously.