Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

opening a file for readin

hello how do i open a file for reading in gcc on linux? thanks

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : hello how do i open a file for reading in gcc on linux? thanks
    :

    Please stick to one topic. This question basically belongs as a response to Actors post.
    Anyway, to help you on your way: http://www.cplusplus.com/reference/clibrary/cstdio/fopen.html

    Basically you want to use the functionality provided by stdio.h. It's usage is similar to printing to the console, only then the function name starts with an f (such as putch becomes fputch) and it has an additional parameter: the pointer to the open file.
    Also special is that you first need to f[b]open[/b] the file and after you're done with it f[b]close[/b] it.
    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.