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.
- your notepad file open file
fopen(const char * filename, const char * mode)
. - when open file read file
fread(void * ptr, size_t size, size_t count, file * stream)
- 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
Post a Comment