blob: 2a22dd96c3454b8b44914f181ad3b44e2c38c4a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
class CLASS22
{
static int nb = 2;
void T22 ( ) { nb = nb / 0 ; }
}
public extern void object :: TEST()
{
switch ( 1 )
{
case 1:
{
file h();
h.open("Mon Fichier.txt", "r");
show ( h.filename, h.handle );
h.filename = "xx";
h.handle = 1 ;
h.readln();
h.close();
}
case 2:
{
file h("Mon Fichier.txt");
h.open("r");
h.readln();
h.close();
}
case 3:
{
file h("Mon Fichier.txt", "r");
h.readln();
h.close();
}
case 4:
{
file h();
h.filename = "Mon Fichier.txt";
h.open("r");
h.readln();
h.close();
}
case 5:
{
file h = fileopen( "Mon 2Fichier.txt", "r" );
h.readln();
h.close();
}
}
{
file h( ) ;
h.filename = "Test.h";
h.open ( "r" );
file pf ( "Mon Fichier.txt" ) ;
pf . open ( "w" ) ;
pf . writeln ( "Voici encore du texte" ) ;
pf . writeln ( "et une seconde ligne" ) ;
pf . close( );
pf . open ( "r" ) ;
while ( not pf . eof( ) )
{
string s = pf . readln ( );
show ( s );
}
pf.close( );
}
}
|