Jump to content

How to read a section of a txt file

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
diego_pmc

diego_pmc

    Newbie

  • Members
  • Pip
  • 2 posts
First of all I should mention that I know next to nothing about using files in C++, so please be explicit. ;)
I want to make a program that would be able to read and then print out certain sections of the text file I give it.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
The first thing you need to do is learn file access. Do you know how to open files?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
killcode

killcode

    Learning Programmer

  • Members
  • PipPipPip
  • 96 posts
wingedpanther, is it fopen?
Posted Image

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I would use a file stream if it's in C++, fopen if it's C. To be honest, reading/writing to a file isn't that hard, it's the OTHER processing that will get interesting. For example, what "other sections" will be printed?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog