summaryrefslogblamecommitdiffstats
path: root/šola/p2/dn/dn06-naloga1.c
blob: 9301d715c04c78e336eb5b4b8c08878a17eca65a (plain) (tree)




























                                               
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "naloga1.h"
char * zdruzi (char ** nizi, char * locilo) {
	int ll = strlen(locilo);
	int len = 1-ll;
	char ** n = nizi;
	while (*n)
		len += strlen(*n++)+ll;
	char * r = malloc(sizeof *r * (len+1));
	char * rorig = r;
	while (*nizi) {
		strcpy(r, *nizi);
		r += strlen(*nizi);
		nizi++;
		if (*nizi) {
			strcpy(r, locilo);
			r += ll;
		}
	}
	return rorig;
}
#ifndef test
int main () {
	return 0;
}
#endif