[ create a new paste ] login | about

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

C++, pasted on Jan 10:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>
int main()
{
    char s1[] = "1234567890";
    char s2[] = "12345";
    char *p = new char[15];
    strcpy(p, s1);
    printf("%s\n", p);
    strcpy(p, s2);
    printf("%s\n", p);
    printf("%s\n", p+6);
}


Output:
1
2
3
1234567890
12345
7890


Create a new paste based on this one


Comments: