Thread: arrays

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    13

    arrays

    ok thanks
    Last edited by sean...; 02-18-2005 at 04:10 AM.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    143
    Hint: Take a look at the functions strspn() and strlen()...
    edit: sorry, I just noticed that you are looking at arrays of ints so you can't use these useful string functions. The pseudo code you want is something like:
    Code:
    for every value in a {
      for every value in b {
        if values in a and b are equal move on to next value in a
      }
      if you got to the end of b and didn't find a match then return 0
    }if you get here, return 1 (arrays are equivalent)
    Last edited by DavT; 02-18-2005 at 03:03 AM. Reason: misread question!
    DavT
    -----------------------------------------------

  3. #3
    ---
    Join Date
    May 2004
    Posts
    1,379
    if the arrays are typecasted into the function it should work. other than that the arrays should be type char anyway.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  4. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM