File: string

package info (click to toggle)
tcng 10b-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,632 kB
  • ctags: 2,515
  • sloc: ansic: 19,038; pascal: 4,640; yacc: 2,619; sh: 1,908; perl: 1,546; lex: 772; makefile: 755
file content (61 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (5)
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
# strings can be assigned to variables ----------------------------------------
tcc -c -u stderr -Wnounused 2>&1
$x = "hello";
EOF
$x = "hello"
# strings can be concatenated with + ------------------------------------------
tcc -c -u stderr -Wnounused 2>&1
$x = "str"+"cat";
EOF
$x = "strcat"
# strings can be compared (a < b) ---------------------------------------------
tcc -c -u stderr -Wnounused 2>&1
$a = "a" < "b";
$b = "a" <= "b";
$c = "a" == "b";
$d = "a" >= "b";
$e = "a" > "b";
$f = "a" != "b";
EOF
$a = 1
$b = 1
$c = 0
$d = 0
$e = 0
$f = 1
# strings can be compared (a == a) --------------------------------------------
tcc -c -u stderr -Wnounused 2>&1
$x = "a";
$a = $x < "a";
$b = $x <= "a";
$c = $x == "a";
$d = $x >= "a";
$e = $x > "a";
$f = $x != "a";
EOF
$x = "a"
$a = 0
$b = 1
$c = 1
$d = 1
$e = 0
$f = 0
# strings can be compared (b > a) ---------------------------------------------
tcc -c -u stderr -Wnounused 2>&1
$x = "b";
$y = "a";
$a = $x < $y;
$b = $x <= $y;
$c = $x == $y;
$d = $x >= $y;
$e = $x > $y;
$f = $x != $y;
EOF
$x = "b"
$y = "a"
$a = 0
$b = 0
$c = 0
$d = 1
$e = 1
$f = 1