Open main menu

Difference between revisions of "HOWTO-Open Files"

18 bytes added ,  15:01, 25 October 2018
m
Text replacement - "<source lang=" to "<syntaxhighlight lang="
(Fix syntax highlighting)
m (Text replacement - "<source lang=" to "<syntaxhighlight lang=")
Line 9: Line 9:


The basic case: you want to open a file called "datafile.dat":
The basic case: you want to open a file called "datafile.dat":
<source lang="cpp">
<syntaxhighlight lang="cpp">
#include "common/file.h"
#include "common/file.h"


Line 20: Line 20:


Or, you want to open a file called "datafile.dat" in a subdirectory "data" of the game directory:
Or, you want to open a file called "datafile.dat" in a subdirectory "data" of the game directory:
<source lang="cpp">
<syntaxhighlight lang="cpp">
#include "common/file.h"
#include "common/file.h"


TrustedUser
2,147

edits