View Single Post
  #15 (permalink)  
Old March 30th, 2004, 03:38 PM
CNewbie CNewbie is offline
Authorized User
 
Join Date: Mar 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok Dave I understand what you are saying, but:

#1 here is my new code that is doing what I just posted it is doing:

Code:
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

int main()
{ 
    char RawPacket[227];                               //make Array for Raw packet Bytes
    int INSLength;                                     //Make Int Variable for Packet Length Byte
    fstream Log("Log.txt",ios::in);                    //Open "Log.txt" For Reading
    fstream Parse("Parsed.txt",ios::out);              //Open "Parsed.txt" for Writing
    Log.getline(RawPacket,227);                        //Get Packet String
    INSLength = RawPacket[8,9];                        //Get Packet Length Byte and store in "INSLength"
    Parse << RawPacket[0] << RawPacket[1] << " "       //Output "48"
          << RawPacket[2] << RawPacket[3] << " "       //Output "40"
          << RawPacket[4] << RawPacket[5] << " "       //Output "20"
          << RawPacket[6] << RawPacket[7] << " "       //Output "00"
          << RawPacket[8] << RawPacket[9] << endl      //Output "39"
          << RawPacket[10] << RawPacket[11] << endl;   //Output "40"
                                                       //Output looks like this:
                                                       //48 40 20 00 39
                                                       //40
    Log.close();                                       //Close Log.txt
    Parse.close();                                     //Close Parsed.txt

return 0;
}
Now I debugged the storage of the packet length by outputting it to screen and when I did so it outputted "39" with the multi demensional array I used.

Reply With Quote