File: step101.slog

package info (click to toggle)
debmake-doc 1.22-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 12,952 kB
  • sloc: makefile: 916; sh: 692; python: 202; ansic: 114; sed: 16
file content (25 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (3)
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
 $ cat debhello-0.3/src/hello.c
#include <stdio.h>
#include <string.h>
#define LEN_NAME 10
int
main(int argc, char *argv[])
{
    int i, len;
    char name[LEN_NAME];
    if (argc == 2) {
        for (i=0;argv[1][i]!='\0'; i++) {
            if (argv[1][i] >= 'a' && argv[1][i] <= 'z')
                name[i] = argv[1][i] -'a' + 'A';
            else
                name[i] = argv[1][i];
        }
        name[i] = '\0';
        printf("Hello, %s!\n", name);
    }
    else
        printf("Hello! Run this with one argument!\n");

    return 0;
}