Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <locale.h>
- #pragma warning (disable: 4996)
- typedef struct Word
- {
- char word[100]; //word itself
- char transA[100]; //translate 1
- char transB[100]; //translate 2
- char typeA; //verb, noun, adj
- char typeB; //verb, noun, adj
- char example[100]; //example sentence
- char dateAdded[11]; //DD.MM.YYYY 10 + '\n'
- char transRating; //0-10
- }Word;
- typedef struct Node
- {
- struct Word word; //word struct
- struct Node *next;
- }Node;
- int main()
- {
- FILE *fpBg;//, *fpEng, *fpGer;
- if ((fpBg = fopen("bg.lang", "rb")) == NULL) { exit(10); }
- //if (fpEng = fopen("eng.lang", "rb") == NULL) { exit(11); }
- //if (fpGer = fopen("ger.lang", "rb") == NULL) { exit(12); }
- Node *head = NULL;
- head = malloc(sizeof(head));
- strcpy(head->word.word, "Test");
- strcpy(head->word.transA, "Тест");
- strcpy(head->word.transB, "Testttt");
- head->word.typeA = 'n';
- head->word.typeB = 'n';
- strcpy(head->word.example, "Testing this modafuka");
- strcpy(head->word.dateAdded, "12.12.1998");
- head->word.transRating = '5';
- setlocale(LC_ALL, "");
- printf("%ls\n", L"s:\\яшертыHello");
- printf("%s\n", head->word.word);
- printf("%s\n", head->word.transA);
- printf("%s\n", head->word.transB);
- printf("%c\n", head->word.typeA);
- printf("%c\n", head->word.typeB);
- printf("%s\n", head->word.example);
- printf("%s\n", head->word.dateAdded);
- printf("%c\n\n", head->word.transRating);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement