Go to specific line in a file (suggest better way) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Go to specific line in a file (suggest better way)

I made a program to output a line of text from file . The program accepts line number and prints whatever text is on that line. I want to know if there is a better way to do this? I'm using getline function to read a line from file but I only print the last line read.....So I think that's not efficient way to do if files are larger. (0_o) I can't link any other files so I'm just using source file to perform actions.... checkout code and suggest better way. https://code.sololearn.com/cI3eoGoKb0fD/?ref=app Thank you.

29th Sep 2019, 10:10 AM
🇮🇳Omkar🕉 - avatar
0 Answers