Thread: finding MSB in a string

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    108

    finding MSB in a string

    hi,

    i'd like to find the most significant byte or bit within a string of chars. the size of the string is not set and can vary.

    my char is something like:

    Code:
    unsigned char mystring = "WWW003674574574asdgasdgas000000";
    and i'd like to find the HIGHEST occurance of a non zero character (in this case s i think) and display it as the address it is contained in. the data is written into the string after bieng received from a port starting at "WWW"

    i'll then search through another character and display the diference between the two strings as a number of bytes.

    is there a specific function that will do it or do i need to use
    Code:
    if
    loops to find occurances of non zero characters?

    thanks
    Last edited by shoobsie; 11-08-2005 at 02:42 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. RicBot
    By John_ in forum C++ Programming
    Replies: 8
    Last Post: 06-13-2006, 06:52 PM
  2. problems with overloaded '+' again
    By Brain Cell in forum C++ Programming
    Replies: 9
    Last Post: 04-14-2005, 05:13 PM
  3. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 10:33 PM
  4. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM