Write a function that takes a file name as argument and prints all unique words in it.
We strongly recommend you to minimize your browser and try this yourself first
The idea is to use map in STL to keep track of words already occurred.
code practice qa quiz
Thanks to Utkarsh for suggesting above code.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- C Program to print contents of file
- C program to copy contents of one file to another file
- Print individual digits as words without using if or switch
- Find and print duplicate words in std::vector<string> using STL functions
- Print "Hello World" in C/C++ without using any header file
- C++ program to create a file
- C program to delete a file
- C Program to find size of a File
- C++ program to append content of one text file to another
- C Program to count number of lines in a file
- C Program to merge contents of two files into a third file
- Write a C program that displays contents of a given file like 'more' utility in Linux
- Program to print last 10 lines
- C++ program to print all Even and Odd numbers from 1 to N
- Program to print Happy Birthday
- Program to print a pattern of numbers
- C++ Program to Print Cross or X Pattern
- Program to print the diamond shape
- C++ Program to print an Array using Recursion
- Program to Print Mirrored Hollow Parallelogram