i would like to make my program know the HEX in my input file, for example
(0x27a50004(in hex) = addu $s1, $s2, $s3)
then my program read it know 0x27a50004 after that the program will add it
for me and i need to store the s1 value register in my other array.
therefore later i can call it back and add s1 +s2 something like that~
i just dunno why if i don't have char d[5000000]; this array i just can read
the first line ~
if i have char d[5000000]; i can read second line, so did any one can teach
me??
thanks a lot
My code::
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
char c[5000000];
char d[5000000];
int main()
{
ifstream ifs;
ifs.open("opcode.txt",ios::binary);
if (ifs)
{
ifs >> c;
ifs >> d;
ifs.close();
}
else
{
cout <<"no file"<<endl;
}
cout << c << endl;
cout << d << endl;
return 0;
}
"Milk" <mi*********@hotmail.com> ¼¶¼g©ó¶l¥ó·s»D:40******@lungfunggdn.org...
HI,
i try to read my HEX file, but i dunno why i just can read the first one
in my file ?
anyone can help me?
My code:
char c[5000000];
char d[5000000];
int main()
{
ifstream ifs;
ifs.open("opcode.txt",ios::binary);
if (ifs)
{
ifs >> c;
if
{
cout<< c <<endl;
}
else
{
cout <<"no file"<<endl;
}
~ Let us linux ~
~ Let us linux ~
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----