Search:

Type: Posts; User: Evenstevens

Search: Search took 0.00 seconds.

  1. Forcing a "leading 0" on 2 bit hexidecimal values

    If I'm printing a hex value ala...


    printf("%x", number)

    and it only turns out to be anything from 0 to F, how can I force a leading 0?

    So it gets printed out as 09, 0F etc.

    So it's...
  2. Cheers, that was just what I needed :)

    Cheers, that was just what I needed :)
  3. Easier way of concatenating a lot of strings?

    I have a bunch of variable strings and was wondering if there was a quicker/easier way of sticking them all together into one big string other than with strcat(a, strcat(b, strcat(c,d))))
  4. I figured it out. It was just putting carriage...

    I figured it out. It was just putting carriage returns ('\r') at the end of each line rather than '\n'

    Rather annoying.
  5. Does copying and pasting put a different...

    Does copying and pasting put a different character code at the ends of lines or something? like '\0' instead of '\n'?
  6. So...my program works with a certain input file but not another with the same content

    ...not entirely sure...

    I have a program which takes in a text file and processes what's in there etc. It's the text file I've used with all my tests, I've edited it to test whatever circumstances...
  7. Gotchya, cheers.

    Gotchya, cheers.
  8. Sorry...i don't quite understand what's going on...

    Sorry...i don't quite understand what's going on there :-\
  9. Replies
    8
    Views
    5,718

    The numbers are in character format so reading an...

    The numbers are in character format so reading an integer wouldn't quite work would it?

    As x,y or z could be 3, 15 and 2318493, for example.
  10. Replies
    8
    Views
    5,718

    Validation of string format

    Say I have a string in the format "&x,&y,&z", is there a quicker way of validating it for 'correctness'

    I'm trying to make a program which accepts the string in that format (Ampersand, integer of...
  11. Hmm, I've had a shot but with no success - Is...

    Hmm, I've had a shot but with no success -

    Is there a way to convert your way of separating strings into something with a 2D array, as I need to reference specific characters in the string later...
  12. Oh, nevermind, I fixed it.

    Oh, nevermind, I fixed it.
  13. I copied your code into a test program just to...

    I copied your code into a test program just to see what happened and it seg faulted...

    I tracked it down to the while loop test but can't seem to fix it :-\
  14. Strtoking where a delimiter appears after itself.

    Say I'm strtoking a string that is in the format

    a:b:c:d:e:f:g

    And I want a,b,c,d,e,f and g to go into arrays made for them

    i.e.
    array[0] would contain a
    array[1] would contain b...
  15. Replies
    7
    Views
    4,344

    Okay, so basically I have an instruction table...

    Okay, so basically I have an instruction table which looks like this to work from:

    http://i40.tinypic.com/s2e5q1.jpg

    Are you saying I make an enum with every "instruction" in it?

    i.e.

    ...
  16. Replies
    7
    Views
    4,344

    Therein lies the problem though. There's...

    Therein lies the problem though. There's like...30 different "types" of instruction. So I have no idea at what angle to come at this from.
  17. Replies
    7
    Views
    4,344

    Building an assembler in C O_o

    Seriously stuck here

    I have to build an assembler and I'm getting stuck on the first bit :-(

    I need to read each line of the input file. i.e


    loop:
    add $1,$1,$1
    b loop
  18. Replies
    7
    Views
    1,623

    Cheers, the strtok method worked really well for...

    Cheers, the strtok method worked really well for what I wanted :-)

    Really fast replies as well.

    Maz, I tried a method similar but it just completely failed. I got in a jumble with myself so...
  19. Replies
    7
    Views
    1,623

    Splittig a string into multiple strings

    Lets say I have input of "Oh my god I like pies" or something equally ridiculous, I'm having trouble getting this into multiple character arrays so that it's like...

    Array 1 is Oh
    Array 2 is my...
Results 1 to 19 of 19