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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -