user input type variables

This is a discussion on user input type variables within the C++ Programming forums, part of the General Programming Boards category; sorry this is another post from a flurry of recent ones. I have a program that looks for a series ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    99

    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?

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

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    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, 04:25 PM
  2. Replies: 4
    Last Post: 04-03-2008, 10: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-17-2006, 12:35 AM
  5. Replies: 4
    Last Post: 04-21-2004, 05:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21