Search:

Type: Posts; User: pgcrooks

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    3,892

    Ok I think I messed up the function call in that,...

    Ok I think I messed up the function call in that, so I messed around and have tried it this way, also with no luck. It outputs "35", which I guess means it opened the port ok and sent 5 characters to...
  2. Replies
    81
    Views
    15,347

    Man this thread is awesome... and sorry...

    Man this thread is awesome... and sorry abachlerm, I may have to quote you on that!
  3. Replies
    6
    Views
    3,892

    Ok, sorry was rushing to get out of work so just...

    Ok, sorry was rushing to get out of work so just put the entire program on here! Here's a shortened version with just the output code.



    #include <stdio.h>
    #include <stdlib.h>
    #include...
  4. Replies
    6
    Views
    3,892

    Salem that may explain it... Well I have now...

    Salem that may explain it... Well I have now rewritten it using this guide which as far as I can tell should work on any POSIX architecture but still have no luck. Now the little moxa just outputs to...
  5. Replies
    6
    Views
    3,892

    Moxa 7112 Programming

    Hey guys, just wondering if anyone here has any experience programming Moxa devices? Basically I have a Debian box which runs my little serial program fine (all it does is ouput to a serial port)...
  6. Thread: Int to Float

    by pgcrooks
    Replies
    8
    Views
    2,092

    Thanks Pete, I realise float and double are...

    Thanks Pete, I realise float and double are different, I just copied and pasted the same thing 3 times above. Found the problem, turns out I'm a complete idiot and used %d in the printf command. Oh...
  7. Thread: Int to Float

    by pgcrooks
    Replies
    8
    Views
    2,092

    Hey guys, sorry to bring back an old thread but...

    Hey guys, sorry to bring back an old thread but I'd rather do this than start a new one!

    I'm basically having trouble converting an int to a float. I've tried the following code and ever single...
  8. Replies
    13
    Views
    1,661

    Thanks guys, got it working in the end. Just used...

    Thanks guys, got it working in the end. Just used Rasta's assign technique, much easier! I forgot you could do that with single chars, just not with full strings (think that's right).
  9. Replies
    13
    Views
    1,661

    Ok, thats seems to have compiled ok! Just had to...

    Ok, thats seems to have compiled ok! Just had to modify the order


    strncpy(oldadd, &(indata[1]), 2);

    Have about a million other syntax errors to fix before I can actually run the program, lets...
  10. Replies
    13
    Views
    1,661

    Humm I shall have to learn more about pointers,...

    Humm I shall have to learn more about pointers, never really got my head around the snytax for them. Thanks anyway!



    addptr = *indata[2];
    strncpy = (oldadd, addptr, 2);


    Right, tried that...
  11. Replies
    13
    Views
    1,661

    Hey anon, thanks for the quick reply. The...

    Hey anon, thanks for the quick reply.

    The problem with strcpy or strncpy is that it copies the string from the start, I want to ignore the 1st character (ie. start at indata[1] and not indata[0]).
  12. Replies
    13
    Views
    1,661

    Help with String Operations

    Hey all,

    I've searched far and wide for an answer to this but have yet to find a case which is the same as mine...

    Basically I have a string (indata), eg "1234" and I want to be able to copy...
Results 1 to 12 of 12