tests/basic/string-lit-2.sp
author David Anderson <dvander@alliedmods.net>
Tue Jan 01 15:34:07 2013 -0800 (2013-01-01)
changeset 251 ca99a81745fe
parent 236 072f1114ea5d
child 263 ba85a47ee414
permissions -rw-r--r--
Refactor compilation process around the new concept of packages.
     1 native PrintNum(num);
     2 
     3 f(x)
     4 {
     5     new char:str1[];
     6     new char:str2[4];
     7 
     8     str1 = "hello";
     9     str2 = "bye";
    10 
    11     // Make sure modifying the string doesn't modify the
    12     // canonical literals.
    13     if (x) {
    14         str1[1] = 65;
    15         str2[1] = 68;
    16     }
    17 
    18     PrintNum(str1[1]);
    19     PrintNum(str2[1]);
    20 }
    21 
    22 public main()
    23 {
    24     f(1);
    25     f(0);
    26 }