[ create a new paste ] login | about

Link: http://codepad.org/dc8bXlrt    [ raw code | output | fork ]

C, pasted on Jul 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
    int i, repeat;
    const char *str;
    if (argc < 3) {
        fprintf(stderr, "error: need more arguments\n");
        return 1;
    }
    repeat = atoi(argv[1]);
    str = argv[2];
    for (i = 0; i < repeat; i++) {
        printf("%s", str);
    }
    printf("\n");
    return 0;
}


Output:
1
error: need more arguments


Create a new paste based on this one


Comments: