Hi, i have some problem with merging two arrays. Array "out" should merge with itself - merge all new user input. I cant figure out how to do this ... please help and sorry for my english - its not my native language
Code:
#include<stdio.h>
#define MIN 80
#define MAX 1000
int getl(char in[], int min);
void copy(char data[], char actual[]);
main(){
char line[MAX];
char out[MAX];
int ll;
ll = 0;
while(ll = getl(line, MIN) && line[0] != '.')
{
copy(out, line);
}
printf("%s", out);
return 0;
}
int getl(char in[], int min)
{
int i,c;
for(i = 0; i < MAX-1 && (c = getchar()) != EOF && c != '\n'; ++i)
{
in[i] = c;
}
if(c == '\n')
{
in[i] = c;
++i;
}
return i;
}
void copy(char data[], char actual[]){
int i;
for(i = 0; i < MAX ; ++i)
{
data[i] = actual[i];
}
}