Thread: user input type variables

  1. #1
    Registered User
    Join Date
    Apr 2008

    user input type variables

    sorry this is another post from a flurry of recent ones. I have a program that looks for a series of hex digits hard coded in my program like below and searches for them. Ive decided now to try and make it so the user can enter there own search criteria now from a text box field in my program. However when the user enters there criteria it comes out as a string and as i am trying to search for hex characters, i thought i would need to input as an array? I hope that makes sense. i thought converting the string to an array be a possible option but that would spilt up each hex character into something like ''0'', "x","F","F" i think?

    static char match_criteria[] = { 0xFF, 0xD8, 0xFF, 0xE0 };

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    strtol allows you to convert a string of hexadecimal into a (long) integer.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Replies: 4
    Last Post: 04-03-2008, 09:07 PM
  3. How to force user to input a value in the type limit
    By salvadoravi in forum C Programming
    Replies: 11
    Last Post: 01-21-2008, 09:47 AM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. Replies: 4
    Last Post: 04-21-2004, 04:18 PM