c++ - Turbo C Database in Notepad -


i'm working on case study myself - japanese english dictionary using turbo c , notepad.

relevant part of code:

#‎include‬ <stdio.h>  main()  {      file *a;      char word[20], ans[1];      clrscr();      a=fopen("dictionary.dbf","a");           {          printf("add word: ");          scanf("%s",&word);          fprintf(a,"%s \n",word);         printf("add one? (y/n)");          scanf("%s",ans);     }while(strcmp(ans,"y")==0);      fclose(a);  } 

this code enables me insert word tc , saves notepad. unfortunately, don't know how print word notepad display tc.

i need little guys. case study, , case study without having group.

just few easy steps.

  1. your notepad file open file fopen(const char * filename, const char * mode).
  2. when open file read file fread(void * ptr, size_t size, size_t count, file * stream)
  3. now final step... print on console or anywhere want, can use fwrite(const void * ptr, size_t size, size_t count, file * stream) operation.

i hope write code. not forget apply error checks.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -