Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //check what autoanaforiki means
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <time.h>
- typedef struct cList
- {
- char *concept; //concept learned
- char *sentence; //the sentence associated with the concept
- int timesUsed; //no of times the concept was used to an answer
- char learnedFrom[5]; //learned either from "file" or "kbrd"
- }conceptList;
- int main(void)
- {
- char array[10000];
- int sum,i,conceptstart,conceptend;
- conceptList c[1];
- scanf("%s",c[0].learnedFrom);
- printf ("%s \n",c[0].learnedFrom);
- scanf("%d",&c[0].timesUsed);
- printf("%d \n",c[0].timesUsed);
- scanf("%s",array);
- for (i=0;i<10000;i++)
- {
- if ((array[i])==('\n'))
- {
- sum=i;
- break;
- }
- printf("%d\n",i );
- }
- for (i=0;i<sum;i++)
- {
- if ((array[i])==('>'))
- {
- conceptstart=i+2;
- }
- if ((array[i])==(':'))
- {
- conceptend=i-1;
- }
- }
- c[0].concept=(char*)malloc((conceptend-conceptstart)*sizeof(char));
- for (i=conceptstart;i<conceptend;i++)
- {
- (c[0].concept)[i]=array[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement