{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Exam2_Review_Key.6 - g void g f void h int x = y int y = 2...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CPSC 121 Exam 2 Review Key 30. The following C++ code fragment won’t compile because of scoping problems. Rewrite it correctly. Note: Don’t worry about the infinite loop, just get it to compile. void f() {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: g(); } void g() { f(); } void h() { int x = y; int y = 2; g(); } void g(); //Declare g() so we can use it void f() { g(); } void g() { f(); } void h() { int y = 2; //Re-order x and y int x = y; g(); }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online