sed range of lines result

C++
# Basic syntax with sed:
sed -n 'start,endp' input_file.txt
# Where start and end are numbers that inclusively define the range. E.g.
sed -n '17,23p' input_file.txt # To print the [17-23] rowsip address | sed -n '2, 4p'
Source

Also in C++: