[ create a new paste ] login | about

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

C++, pasted on May 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <string.h>
#include <memory.h>

int main(int argc, char* argv[])
{
	char str1[256] = "hello world!!!";
	char str2[256] = "yellow dove!!!";

	for (int i = 0; str1[i] != '\0'; i++)
		if (strchr(str2, str1[i]))
		{
			for (int r = i; str1[r] != '\0'; r++)
				str1[r] = str1[r+1]; i--;
		}

	printf("%s\n%s\n",str1,str2);

	return 0;
}


Output:
1
2
hr
yellow dove!!!


Create a new paste based on this one


Comments: