Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5 Given a function func(): void func() static int val > The variable val is belonged to which store address? A. Initialized Data segment B.

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
5 Given a function func(): void func() static int val > The variable "val is belonged to which store address? A. Initialized Data segment B. Uninitialized data or BSS segment C. Heap D. Stack 6. The character A,B,C,D,E pushes into stack order follows ABCDE. What is possible order for character A,B,C,D,E pop out from stack ? A EDCBA; B. DECBA; C DCEAB: D ABCDE 7. #define DOUBLE(X)x+x: + 5*DOUBLE(5): (What is :)? 8. What is the result of Test(void)? void GetMemory(charp) p = (char*)malloc(100): void Test(void) char *str = NULL; GetMemory(str); strcpy(str "hello world"); printf(str); 1 9. What is the result of Test(void)? char "GetMemory(void) char pl] = "hello world": return p: > void Testvold) char str = NULL; str = GetMemory: printf(str): 10 Given that class Oz4 enum( arr_l=5 ) int arr. // array of int int seed; char *name: public: Q24(char "str, inti): name(str), seed(1) { arr = new int[arr 1); for(int i=0;i -Oz40) delete (arr cout void print_arr() { cout void set_arr(int idx, int val) { arr[idx]=val > int get_arr(int idx) return arridx); > }; 11. Can you predict the output of the program below? int main() { Q24 91/"01",0), 2("02",10): q2=91: 91.set_arr(0, 32); 42.set_arr(1, 56); 91.print_arr(); 42.print_arrt); 12. What do the following print? cout (b)? (a) (b)) Please try to use C template coding to replace it 14. Here is C++ example coding Class Person...): Class Student : public Person (...) Void dance(const Person&p): Void study (const Student& s): Person : Students Please point out below which class usage is wrong A dance (p) B. dance (8): C study (s): D. study (p) 15. Write a function to find the second largest number in an array

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

LO4 Provide an overview of four challenges facing HR today.

Answered: 1 week ago