When trying to compile the following code by command line, it returns the following error:
"/ usr / lib / gcc / x86_64-linux-gnu / 5 /../../../ x86_64-linux-gnu / crt1.o: In the function _start ': (.text + 0x20) : reference to main 'undefined collect2: error: ld returned 1 exit status "
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define TAM 10
main()
{
char arreglo[TAM];
char *apc;
apc=arreglo;
srand=(time(NULL));
for(int i=0;i<TAM;i++)
{
*apc=(rand%(11));
*apc++;
}
printf("El arreglo es:\n");
for(int i=0;i<TAM;i++)
printf("%d = %d",(i+1),arreglo[i]);
return 0;
}