// Please help me out. If I replace 'element' with a constant say 10, this works perfectly. But when I take the value of element //from the user, this code gives issues. What could be the reason??
char * chararray;
printf("Enter the number of elements that you would like to enter. \n");
scanf(" %d", &element);
chararray = (char *) malloc(element * sizeof(char));
puts("Enter the elements in your array");
Heap + gets + puts!!! Need help
Post a Reply
|Oldest Newest Rating|
One of the most popular languages of all time.
|Bucky Roberts Administrator|