100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSC 102 Exam 2 Study Guide with Complete Solutions $9.99   Add to cart

Exam (elaborations)

CSC 102 Exam 2 Study Guide with Complete Solutions

 0 view  0 purchase
  • Course
  • 2024/2025
  • Institution
  • 2024/2025

CSC 102 Exam 2 Study Guide with Complete Solutions is the statement int* p; equivalent to int *p; or int * p; - Answer-yes in the stament int* p, q; both are pointers t/f - Answer-false this is valid int *p, *q; - Answer-yes * refers to the ___ to which its ___ points - Answer-object... operan...

[Show more]

Preview 2 out of 8  pages

  • October 16, 2024
  • 8
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • 2024/2025
  • 2024/2025
avatar-seller
Emillect
EMILLECT 2024/2025 ACADEMIC YEAR ©2024 EMILLECT. ALL RIGHTS RESERVED FIRST PUBLISH OCTOBER, 2024




CSC 102 Exam 2 Study Guide with
Complete Solutions

is the statement int* p; equivalent to int *p; or int * p; - Answer✔✔-yes


in the stament int* p, q; both are pointers t/f - Answer✔✔-false


this is valid int *p, *q; - Answer✔✔-yes


* refers to the ___ to which its ___ points - Answer✔✔-object... operand


can you make a pointer that points to an object of another type like a struct - Answer✔✔-yes


dot operator has a ___ precedence than dereferencing operator... solve this - Answer✔✔-

higher...


(*studentPtr).gpa = 3.9;


member access operator also in another form - Answer✔✔-->


syntax for accessing a class member using the operator is - Answer✔✔-pointrVariableName-

>classMemberName


thus - Answer✔✔-Thus,


(*studentPtr).gpa = 3.9;



Page 1/8

, EMILLECT 2024/2025 ACADEMIC YEAR ©2024 EMILLECT. ALL RIGHTS RESERVED FIRST PUBLISH OCTOBER, 2024


is equivalent to:


studentPtr->gpa = 3.9;


t/f Pointer variables must be initialized if you do not want them to point to anything -

Answer✔✔-true


a null pointer - Answer✔✔-p = 0; or p = NULL;


the number __ is the only number that can be directly assigned to a pointer variable -

Answer✔✔-0


new ___ and returns __ - Answer✔✔-allocates memory and returns a pointer to it's (starting

address)


create a pointer pointing to an array of 5 dynamically allocated chars called name. - Answer✔✔-

char *name;


name = new char[5];


if new can't allocate required memory space. it throws - Answer✔✔-the bad_alloc exception


delete a single dynamic variable - Answer✔✔-delete pointerVariable;


delete a dynamically created array - Answer✔✔-delete [] pointerVariable


to avoid __ __, set variable to __ afterwards. - Answer✔✔-dangling pointers... NULL.


operations on pointer variables - Answer✔✔-assignment


- relational operators (two pointers of same type)

Page 2/8

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Emillect. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $9.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

85443 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$9.99
  • (0)
  Add to cart