Hello
I wanna create an application that, inserted words an English and words an another one language will show you this in a random mode.
Also you should be able to insert new words and carry on like this.
I'm not smart enough so I got stuck.
If someone would like to help me giving any advice I will really appreciate.
Thanks in advance
this is my code:
#include <stdio.h>
#include <stdlib.h>
#define T 1
#define F 0
typedef struct elem_s
{
char string[20];
}elem_t;
int main()
{
elem_t database[100][2];
int check = 0; // check it's a flag 1-0,
// 0 if you wanna carry on
// 1 if you wanna exit
char choice[5];
char phraseENG[20];
char phraseIT[20];
int i, j;
do
{
printf("You wanna start or you wanna insert new words?\n (false if you wanna insert a new one, true otherwise) (T/F): \n");
scanf("%s", choice);
}
while(check);
if (choice == F)
{
printf("Insert a new phrase in Italian: \n");
scanf("%s", phraseIT);
printf("Insert a new phrase in English: \n");
scanf("%s", phraseENG);
}
if (choice == T)
{
srand (time(NULL));
choice = rand()%database[100][2];
for(i=0;i<2 ;i++)
{
for(j=0;j<100 ;j++)
{
printf("%s\n", database[100][2]);
}
}
}
return 0;