Merge two arrays

xiaoxiao2021-03-06  41

#include Template t * arraylink (t * a, t * b, int asize, int bsize) {int n = asize bsize-1; t * narray = new T [N 1 ]; While (((n

Void main () {Int a [3] = {11, 13, 15}, b [5] = {21, 24, 23, 27, 29}, * x = arraylink (A, B, 3, 5);

INT N = 8; while (n -) cout << * x << endl;

Char C [3] = {'C', 'B', 'A'}, D [5] = {'T', 'R', 'E', 'W', 'q'}, * y = ArrayLink (C, D, 3, 5);

n = 8; while (n--) cout << * y << ENDL;

Delete [] (x-8); delete [] (Y-8);} The set of pointer operates is too cool ..

转载请注明原文地址:https://www.9cbs.com/read-55677.html

New Post(0)