repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Rebase.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.robertl
/
eb77.C
blob
358c186ab9158b6a7719fca566784ec26e7a569a
1
// { dg-do run }
2
#include <iostream>
3
#include <sstream>
4
5
using namespace std;
6
7
int
8
main(int, char* [])
9
{
10
stringstream s;
11
12
s << "line 1\nline 2\n\nline 4";
13
s << std::ends;
14
15
int nLine = 0;
16
17
while( true ) {
18
char line[100];
19
s.get(line, 100);
20
21
if( ! line ) {
22
break;
23
}
24
25
++nLine;
26
std::cout << nLine << ": " << line << std::endl;
27
28
if( nLine > 10 ) { // stop infinite loop
29
break;
30
}
31
}
32
return 0;
33
}