LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Need Help Converting C# Code to C++ (http://www.linuxquestions.org/questions/programming-9/need-help-converting-c-code-to-c-543117/)

timrs 04-03-2007 06:47 PM

Need Help Converting C# Code to C++
 
I found how to do something in C#, but can't find C++ equivelents. All converters are for C++ to C#, not vice verca. Here:
Code:

            FileStream fs = new FileStream((map.path,
                FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
 
            BinaryReader br = new BinaryReader(fs);
            BinaryWriter bw = new BinaryWriter(fs);
 
            int sig = 0;
            long length = br.BaseStream.Length;
 
            br.BaseStream.Position = 2048;
 
            for (long i = 2048; i < length; i += 4)
                sig ^= br.ReadInt32();
 
            bw.BaseStream.Position = 720;
            bw.Write(sig);
 
            br.Close();
            bw.Close();


nadroj 04-03-2007 07:40 PM

check this link: http://www.cplusplus.com/doc/tutorial/files.html
scroll down to Binary Files

seems like what you may be looking for


All times are GMT -5. The time now is 05:15 AM.