12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Totally Immersed: <strong>C++</strong> Classes and Object-Oriented Programm<strong>in</strong>g<br />

112: speed = head<strong>in</strong>g = altitude = 0;<br />

113: status == ONRAMP;<br />

1<strong>14</strong>: }<br />

115: //<br />

116: // Build a str<strong>in</strong>g to report the airplane’s status.<br />

117: //<br />

118: <strong>in</strong>t<br />

119: Airplane::GetStatus(char* statusStr<strong>in</strong>g)<br />

120: {<br />

121: spr<strong>in</strong>tf(statusStr<strong>in</strong>g, “%s, Altitude: %d, Head<strong>in</strong>g: %d, “<br />

122: “Speed: %d\n”, name, altitude, head<strong>in</strong>g, speed);<br />

123: return status;<br />

124: }<br />

125: //<br />

126: // Get the status str<strong>in</strong>g and output it to the screen.<br />

127: //<br />

128: void<br />

129: Airplane::ReportStatus()<br />

130: {<br />

131: char buff[100];<br />

132: GetStatus(buff);<br />

133: cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!