Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 34 pages
Exam (elaborations)

CSE 240 COMPLETE QUESTIONS AND SOLUTIONS TESTED ANSWERS

Document preview thumbnail
Preview 4 out of 34 pages

CSE 240 COMPLETE QUESTIONS AND SOLUTIONS TESTED ANSWERS

Content preview

CSE 240 COMPLETE QUESTIONS AND
SOLUTIONS TESTED ANSWERS

◉ Given the following:


int num1 = 5; //addressed at 1877112
int num2 = 15; //addressed at 1877300
int num3 = 20; //addressed at 1877192
double d1 = 1.05; //addressed at 1374376
double d2 = 2.25; //addressed at 1374360
double d3 = 3.14; //addressed at 1374344


After these statements:


int* ptr1 = &num3
ptr1 = ptr1 + 5;


What will be the address contained in ptr1?
Answer: 1877212


◉ Which of the following statements will allow me to give the
value of 10 to the memory int* myPtr points to?
Answer: *myPtr = 10;

,◉ int num1 = 5; //addressed at 1767612


int num2 = 10; //addressed at 1767600


int num3 = 15; //addressed at 1767588


char ch1 = 'a'; //addressed at 3734375


char ch2 = 'b'; //addressed at 3734363


char ch3 = 'c'; //addressed at 3734351


char* chPtr = &ch3;


int* iPtr = &num3;


*iPtr = num3 *(times) 8;


'*chPtr' = '*iPtr;'


What will the following statement output?

,cout << ch3;
Answer: 'x'


◉ (True or False) Multiple pointers can reference the same
objects.
Answer: True


◉ C/C++ has 2 pointer operators, which operator represents the
name of the address? (Commonly refer as l-value.)
Answer: Asterisk (*)


◉ Given this snippet of code, what is the value of x after executing
the last statement?


int x = 10, *y;


y = &x;


y = y + 1;


*y = 100;
Answer: 10

, ◉ Given this snippet of code, what is the value of x after executing
the last statement?


int x = 10, *y;


y = &x;


*y = 100;
Answer: 100


◉ Given this snippet of code, what is the value of z after executing
the last statement?


int x = 10, *y, **z;


z = &y;


y = &x;


*y = 100;
Answer: None of the above (Memory Address)


◉ A pointer variable can take the address of a memory location as
its value. Read the given program.

Document information

Uploaded on
August 25, 2026
Number of pages
34
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
TopGradeInsider
4.2
(13)
Sold
165
Followers
2
Items
55375
Last sold
11 hours ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions