LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2007, 06:47 PM   #1
timrs
Member
 
Registered: Nov 2005
Location: MN, US
Distribution: openSuse 10.2
Posts: 93

Rep: Reputation: 15
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();
 
Old 04-03-2007, 07:40 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

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

seems like what you may be looking for
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Windows DLL code to Linux shared library DavidW567 Programming 7 07-27-2010 08:15 AM
small syntax problem with C code (implemented in Code Composer Studio) illiniguy3043 Programming 6 01-07-2008 02:14 AM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
converting vb6 code to python mrobertson Programming 2 06-02-2005 01:27 PM
Converting bash command to C code Linh Programming 3 06-13-2003 10:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration