0

Hi, I am new to C++.Pls help me out.would really appreciate it.

The problem goes like this.

There are two files. In file1(say data1.txt)u have got something like this
Line1:Hello How
Line2:We are fine

the work is grab each string and assign it with a binary file and enter it in a new file(say data2.bin) and every line must correspond to that line from data1.txt

if the String "Hello" corresponds to "0001" and How as "0002" in line 1 then the line 1 of file in data2.bin should like this

"00010002"

Please help me out.

3
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by vk10
0

binary files do not have lines -- they are just a stream of bytes that could contain anything between 0 and 255. What you are talking about is a text file, not a binary file.

Post the actual input file, not just an explanation of what it contains.

0

The first file ( file1.asm) which contains
ADD R1 R2 R3
LOAD R4 R5

has to be converted into the appropriate binary code

For ADD it is 01011
For R1 it is 01110

So my file file2.bin should like
0101101110

Like this, it should compare each and every word and line and then it should produce the output in file2.bin.

Hope this helps for u to help me out.

0

thats the appropriate Binary Code for ADD.we have to convert Assembly codes such as ADD into binary digits.I dont have any table. would be great if u could provide with a code.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.