13.01.2015 Views

Pensar en C++ (Volumen 1) - Grupo ARCO

Pensar en C++ (Volumen 1) - Grupo ARCO

Pensar en C++ (Volumen 1) - Grupo ARCO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

✐<br />

✐<br />

✐<br />

“Volum<strong>en</strong>1” — 2012/1/12 — 13:52 — page 199 — #237<br />

✐<br />

6.6. Inicialización de tipos agregados<br />

string line;<br />

// Read file and store lines in the stack:<br />

while(getline(in, line))<br />

textlines.push(new string(line));<br />

// Pop the lines from the stack and print them:<br />

string* s;<br />

while((s = (string*)textlines.pop()) != 0) {<br />

cout

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

Saved successfully!

Ooh no, something went wrong!