Hi,
I have been trying to run the program on visual studio c++ but it keeps giving me the error that alloc.h does not exist.
Is it that the new compilers donot have some of the header files and/or i need to have some other decalaration for it?
insert
Code:
#include <stdio.h>
#include <conio.h>
#include <alloc.h>
void main(){
char *names[6];
char n[50];
char *p;
int i, len;
for(i=0;i<6;i++)
printf("\n\r%u", names[i]);
for(i 0;i< 6;i++){
printf("Enter the number");
scanf("%s",n);
len = strlen(n);
p = malloc(len+1);
strcpy(p,n);
names[i] = p;
}
for (i =0;i< 6;i++){
printf("%s", names[i]);
}
/*for(i=0;i<6;i++){
printf("Enter the names");
scanf("%s", names[i]);
}*/
}