Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cs50.h>
- #include <stdio.h>
- // Loads dictionary into memory, returning true if successful else false
- bool load(const char *dictionary)
- {
- char *small_dictionary = "../dictionary";
- FILE *dict = fopen(small_dictionary, "r");
- if (dict == NULL)
- {
- fprintf(stderr, "Could not open\n");
- return 2;
- }
- printf("This is the dictionary: %s\n", small_dictionary);
- return false;
- }
- int main(int argc, char *argv[])
- {
- if (argc != 2)
- {
- printf("error");
- return 1;
- }
- char *dictionary = argv[1];
- load(dictionary);
- }
Advertisement
Add Comment
Please, Sign In to add comment