victor's way is correct, but in my eyes the 'MAX' is a big limit
don't limit your program to a MAX-value, very hard to debug.
do it dynamically, usind alloc,realloc
now the installed physical-mem of the system, is your limit.
put this in a file called 'array.h'
#define ValueLF __LINE__,__FILE__
#define DeclaLF int ccline, char *ccfile
#define ParamLF ccline, ccfile
#define PrintLF "\n[%d]%s: Fatal-Error calling %s Out of Memory. Exiting\n\n",ParamLF
struct xxx { long cnt; char **line; };
typedef struct xxx MyArray;
int dejavu_arr(MyArray *,char *);
int freearray(MyArray *);
int showarray(MyArray *);
void add2array(MyArray *,char *,int,char *);
MyArray *newarray(MyArray *);
------------- this is your prog
#include <stdio.h>
#include .....
#include .....
#include .....
#include .....
#include "array.h"
int main(int argc, char **argv)
{
char *ck_malloc(unsigned int,int,char *);
char *ck_realloc(char *,unsigned int,int,char *);
MyArray *newarray(MyArray *);
MyArray *array = (MyArray *)NULL;
array = newarray(array); /* initialize it */
while( .....reading somethings in buff .....){
if(dejavu_arr(array,buff)) continue; /* to unique fill array */
add2array(array,buff,ValueLF);
}
showarray(array);
freearray(array);
exit(0);
}
#define LINEA array->line
#define INDEX array->cnt
MyArray *newarray(MyArray *array)
{
if(array == NULL) array = (MyArray *)calloc(1,(unsigned)sizeof(MyArray));
if(array == NULL) exit(fprintf(stderr,"cannot alloc struct, exiting\n"

);
INDEX = (long)NULL; LINEA = (char **)NULL; /* init array to NULL */
return(array);
}
int showarray(MyArray *array)
{
if(INDEX){
int pos;
for(pos = 0; INDEX >pos; ++pos) printf("%s\n",LINEA[pos]);
}
return(INDEX);
}
int freearray(MyArray *array)
{
while(INDEX >0) free(LINEA[--INDEX]);
free(LINEA);
return(0);
}
int dejavu_arr(MyArray *array, char *toadd)
{
if(toadd){
int pos = 0;
for(; INDEX >pos; ++pos) if(!strcmp(toadd,LINEA[pos])) return(1+pos);
}
return(0);
}
void add2array(MyArray *array, char *toadd, DeclaLF)
{
if(!toadd) return;
if(!INDEX++) LINEA = (char **)ck_malloc((INDEX * sizeof(char *)),ParamLF);
else LINEA = (char **)ck_realloc((char *)LINEA,(INDEX * sizeof(char *)),ParamLF);
LINEA[INDEX-1] = (char *)ck_malloc(strlen(toadd),ParamLF);
strcpy(LINEA[INDEX-1],toadd);
return;
}
char *ck_malloc(unsigned int size, DeclaLF)
{
register char *pmem;
if((pmem = malloc(size))) return(pmem);
exit(fprintf(stderr,PrintLF,"ck_malloc()"

);
}
char *ck_realloc(char *pmem, unsigned int size, DeclaLF)
{
if((pmem = realloc(pmem,size))) return(pmem);
exit(fprintf(stderr,PrintLF,"ck_realloc()"

);
}
vox clamantis in deserto.