Search:

Type: Posts; User: keithmolo

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    12
    Views
    1,666

    wow you guys are good. i just can't think like...

    wow you guys are good. i just can't think like that ;)

    thanks a bunch.

    keith
  2. Replies
    12
    Views
    1,666

    rounding question

    is it possible to round to the next highest multiple of four? for example:

    if i have the values:

    1.6, 2.3, 3.4, 3.9 - all of them need to be 4.

    4.1, 5.6, 6.3 - all of them need to be 8.
    ...
  3. Replies
    4
    Views
    2,296

    nevermind. i'm dumb, and figured out my problem....

    nevermind. i'm dumb, and figured out my problem. thanks :)
  4. Replies
    4
    Views
    2,296

    initializing hex?

    so right now i am reading in four characters at a time from my input file. my problem happens when there is only one character to read. I need to initialize these other three characters so they...
  5. Replies
    0
    Views
    958

    for loop - extraneous data at end

    Hi. I have just changed my while loop (an eof check) to a for loop.



    for (j=0; j<size2; j++){

    fIn2.read(xCh,4);
    fout.write(xCh,4);
    fIn2.seekg(12,ios_base::cur);
    }
  6. Replies
    12
    Views
    1,517

    oh yeah, i figured this out a while ago. ...

    oh yeah, i figured this out a while ago.


    combine = ((unsigned int) (unsigned char)Cha<<8) | (unsigned int) (unsigned char)Chb;
  7. Replies
    3
    Views
    1,166

    efficient array

    hi, i have created an array, but i am still using it inefficiently. can anyone help me make this code more efficient?



    fIn2.get(xCh[0]);
    fIn2.get(xCh[1]);
    fIn2.get(xCh[2]);...
  8. Replies
    12
    Views
    1,517

    not working with some numbers

    for testing purposes of my code, i created a dat file with the following hex code:

    ------------------------------------------------------------------
    01 02 03 04 05 06 07 08 :: F8 F9 FA FB FC FD...
  9. Replies
    11
    Views
    9,256

    confused

    i tried these methods (at least i think i did them right), and i'm still getting the same repeat of the last result at the end. here is the code i am doing now. i want to read in every two...
  10. Replies
    11
    Views
    9,256

    EOF reading one more extra

    I am using eof in a while loop, and it is reading in one extra time at the true end of file, resulting in repeated data.

    I read the other posts on this, but could not figure out how to use...
  11. Replies
    12
    Views
    1,517

    Re: Re: unpacking after an "or" and a "shift"

    could you please explain how this works? I understand the unpacking part, but am unfamiliar with what values the chars would be taking on. Also, what does the & do in this particular case?
    ...
  12. Replies
    12
    Views
    1,517

    unpacking after an "or" and a "shift"

    hi everyone.


    right now i have read in two characters and combined them into an int. Once i have combined them, i have shifted the whole thing over.

    Now i need to take the combined shift and...
  13. Replies
    12
    Views
    1,403

    oooh awesome, OR'ing was going to be a question...

    oooh awesome, OR'ing was going to be a question later on!

    but i tried using write(&combine,2) and got the following error when compiling:

    'write' : cannot convert parameter 1 from 'int *' to...
  14. Replies
    12
    Views
    1,403

    hrm. when i use this method: ...

    hrm. when i use this method:

    while(!fIn2.eof()) {
    fIn2.get(A);
    fIn2.get(B);
    combine = ((int)A<<8) | (int)B;
    fout.put(combine);

    it seems to be printing out every other int, rather than...
  15. Replies
    12
    Views
    1,403

    hrm. i tried both these methods and they don't...

    hrm. i tried both these methods and they don't seem to give me the results i'm looking for. i'm probably just dumb and am missing something basic, but here is what i DO have:

    i have two ints.
    ...
  16. Replies
    12
    Views
    1,403

    hrm. maybe it would help if i posted code. ...

    hrm. maybe it would help if i posted code.

    int a, b;
    char xCha, xChb;
    int combine;

    fIn2.open(userfilename.c_str(), ios::in | ios::binary);
    fIn2.seekg(ios::beg);
    fIn2.seekp(1000);...
  17. Replies
    12
    Views
    1,403

    2 chars, one int

    ok, little bit of a problem here.

    I am reading in chars, x and y. once read, i need to print them out as y, x.

    I have an int Z which i need to contain y AND x without adding them. so if x...
  18. Replies
    6
    Views
    1,052

    alrighty. say i have to read a lot of bytes (and...

    alrighty. say i have to read a lot of bytes (and i do) and switch every two around....what kind of code am i looking at? any short example-code would help a ton.

    thanks,
    keith
  19. Replies
    6
    Views
    1,052

    endian problem

    I am reading my input file one byte at a time and writing each character to my output file, like so:

    while(!fIn2.eof()) {
    while (fIn2.get(xCh)){
    fout.put(xCh);
    }

    The problem...
  20. Replies
    4
    Views
    4,182

    Thanks, all. this helped mucho! keith

    Thanks, all. this helped mucho!

    keith
  21. Replies
    12
    Views
    2,178

    followup

    Say I have something like the following:

    int total_after_data = x - 44;

    is there anyway to make total_after_data convertible to hex, and printable like the following?

    *(long*)ib =...
  22. Replies
    4
    Views
    4,182

    open input file twice?

    if anyone can help, it would be appreciated.

    i have opened up a file for input. this input file is then read from byte 1000 til the end, and then a byte count is calculated (x). After this, i...
  23. Replies
    12
    Views
    2,178

    Most excellent! Thanks SO much for all your...

    Most excellent!

    Thanks SO much for all your help, this worked, and i think that's it for now.



    keith
  24. Replies
    12
    Views
    2,178

    ok. ALMOST there! when i compile this, i get...

    ok. ALMOST there!

    when i compile this, i get gibberish for everything except for a 2D wherever i put 0x2D in the array. this is correct, but if i put anything longer than 2D, like

    0x2D003EE0...
  25. Replies
    12
    Views
    2,178

    ok, this isn't working for me. i get an error...

    ok, this isn't working for me. i get an error when i compile. perhaps you could look at my code and see what i am doing wrong (something stupid, probably). here is a copy of the error for the...
Results 1 to 25 of 27
Page 1 of 2 1 2