2 main.c
Index: main.c
===================================================================
RCS file: /space/cvs/newhello/main.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -r1.2 -r1.3
9,10c9,10
< char msg_hi[] = { "Hi there, programmer!" };
< char msg_bye[] = { "Goodbye, programmer!" };
---
799
Programming Tools and Utilities 29
> char msg_hi[] = { "Hi there, programmer!\n" };
> char msg_bye[] = { "Goodbye, programmer!\n" };
12c12
< printf("%s\n", msg_hi);
---
> printf("%s", msg_hi);
The diff output is easier to understand than you might expect. Lines that begin with < appear
in the first file (revision 1.2 of main.c) but not in the second (revision 1.3 of main.c). Similarly,
lines beginning with > appear in the second file, but not in the first. Each section of diff output
begins with an alphanumeric sequence such as 9,10c9,10 or 12c12.
The numeric values of the diff output indicate the lines in the first and second files to which an
operation must be applied to get the second file from the first. The operation to perform (such as
inserting, deleting, or changing lines) is specified by the alphabetic character. So, for example, the
sequence 9,10c9,10 means that if you want to create the second file from the first, you have to
change (c) lines 9 and 10 of the first file to lines 9 and 10 of the second file.
Pages:
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445