Thread: Compare input with array element

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    38

    Compare input with array element

    heya,

    sorry stupid question but:

    how can I compare my input with a string element of an array?

    EDIT: check post below for source code

    Hm obviously the "code" of
    strcmp(codes[i].country, code)
    is the issue. I just don't know how I could "parse" code to a string to compare the arraystring with the input code :/

    Thanks in advance!
    Last edited by coffee_cup; 12-03-2012 at 10:52 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compare user input and function with array and bubblesort
    By Gil Carvalho in forum C Programming
    Replies: 15
    Last Post: 06-15-2012, 01:32 PM
  2. Using strncmp to compare input with string
    By lovelace in forum C Programming
    Replies: 9
    Last Post: 10-11-2011, 09:11 AM
  3. Replies: 60
    Last Post: 05-31-2010, 10:57 AM
  4. how to compare element in array
    By hlam in forum C++ Programming
    Replies: 7
    Last Post: 11-29-2003, 12:05 AM
  5. compare input doubles
    By brianptodd in forum C++ Programming
    Replies: 3
    Last Post: 10-19-2002, 08:57 PM