grep ignore repeated lines

C++
Just comgine "sort -u" with grep command to ignore repeated lines:
grep file_name | sort -u
Source

Also in C++: