Frage

I read this commands in c++ language

FILE * fp;
BYTE r,g,b;
fp=fopen(fn,"rb");
fread((BYTE * )&b,sizeof(BYTE),1,fp);

I am Bigeneer in c# ,what is similar commands in c# langugehow can I use pointer (BYTE * )&b in c#

War es hilfreich?

Lösung

You can use FileStream object for File operations and for opening the file you can use File.Open instead of fOpen

Andere Tipps

You can use this for all lines :

using system.IO;

string[] mylines = System.IO.File.ReadAllLines(@"myfile.txt");

Or this for one line :

  string mytext = System.IO.File.ReadAllText(@"myfile.txt");
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top