Texts:
Write the program in C.
Read in the words for the "Reserved Words" array (really a list).
Sort the reserved words into alphabetical order (a → z).
Read in the first byte of the Target file (To be or...).
Check if it is a space or punctuation (isspace(), ispunct()).
If not, put the byte in an array of bytes (one-dimensional).
If yes, then take the word you have parsed (in the one-dimensional array) and compare the word to the Reserved Word List (in the matrix from steps 1 and 2).
This should be a binary search of the RWL.
Read the next byte and then go to step 4.
Print the word on its own line.
Read the next byte and go to step 4.
If the word is on the reserved word list:
File to Parse: (Name it FileToParse.txt)
To be, or not to be, that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles And by opposing end them. To die, to sleep, No more; and by a sleep to say we end The heartache and the thousand natural shocks That flesh is heir to: 'tis a consummation Devoutly to be wished. To die, to sleep; To sleep, perchance to dream, ay, there's the rub: For in that sleep of death what dreams may come, When we have shuffled off this mortal coil, Must give us pause.
Reserved word list: (Name it ReservedWords.txt)
tobeoristheinandofbyaya
Don't use ChatGPT. Don't use single-character variables, only use descriptive variable names. Use only C. The previous expert used ChatGPT, I am really disappointed.