My understanding of getopt is very limited.
I do however realise that argv[0] is the exe file, argv[1] is the option, argv[2] is the word to compare and argv[3] is the dictionary or document I want to search(file .txt).
I'm trying to set a pointer to the dictionary and then iterate through it to see if there is a match with the argv[2] (input word) to the text file, and if there is a match out put the argv[2] word.
Below is my current code that has errors
main.cpp:61: error: no match for 'operator==' in 'list == *(argv + 12u)'
main.cpp:64: error: no match for 'operator*' in '*list'
Any help would be greatly appreciated.
What are you trying to do with the following statement? list == argv[3];
That appears to be doing a pointless comparison of the list container with the third argument. No such comparison is supported by the list container; hence the first diagnostic.
Likewise for the following statement: cout << *list << endl;
You are treating list as a pointer. It's not, therefore the second diagnostic. Also, the << operator is not defined for the list container.
for(i == list.begin();
You're confusing the assignment operator = with the equality operator ==.
You want to assign the iterator i to value return from begin(), not compare it.
Yes, I see what you mean.
The idea was to get list to point to the contents of argv[3] (text file or document) then loop through that to see if there was a match with argv[2] (word) which I currently have as argv[1] my mistake.
Thank you for responding Abstraction Anon.