int main(void)
{
    char *s, *t;

    printf("input string s: \n");
    while (getchars(s, MAXLINE) == 0)
        ;
    printf("input string t: \n");
    while (getchars(t, MAXLINE) == 0)
        ;

    str_cat(s, t);
    printf("cat: %s\n", s);

    return 0;
}
Beispiel #2
0
int main()
    //@ requires true;
    //@ ensures true;
{
    char *array = malloc(100);
    getchars(array, 100);
    putchars(array, 100);
    putchars(array, 100);
    //@ leak characters(array, 100);
    return 0;
}
int main(void)
{
    char s1[MAXLINE];
    char s2[MAXLINE];

    printf("Input some characters, then press enter:\n");
    while (getchars(s1, MAXLINE) == 0)
        ;

    expand(s1, s2);
    printf("\nThe expanded result is:\n%s\n", s2);

    return 0;
}