ooh i was creating an program for dictionary and words....and
the problem is that it ships over the loop for putting a word for container and goes to definition.
oooh by the way if u see the while weird is because im was going to change the struct entry list[num];, and make it soo that every time it loops there would be 1 additional more memory location for list but i'll do that later seen the problem is with the word loop...Code:#include <stdio.h>
struct entry
{
char *word;
char *definition;
};
int main(void)
{
//char *word = "Justin";
//printf("%s",word);
char letter,answer,array[80];
int num,temp=0;
printf("How many entries to define?\n");
scanf("%d",&num);
struct entry list[num];
do
{
printf("Enter words\n");
int i=0;
do
{
letter = getchar();
array[i] = letter;
++i;
}while(letter != '\n');
array[i-1] = '\0';
list[temp].word = array;
printf("%s\n",list->word);
printf("---------------------------------------\n");
printf("Enter definitions\n");
i=0;
do //inputing sentences into definition
{
letter = getchar();
array[i] = letter;
++i;
}while(letter != '\n');
array[i-1] = '\0';
list[temp].definition= array;
++temp;
printf("%s\n",list -> definition);
printf("Do you wish to make another entry(y/n)?");
scanf("%c",&answer);
} while(answer != 'y'); //end entire loop
}