Thread: Character Duplicates

  1. #1
    Honder
    Guest

    Question Character Duplicates

    Can anyone tell me if there is a function in c++ that will go through all elements in an array and say if there were any duplicates. E.g,

    Array[]="aaa","aaaa","aaa"

    elements 0 and 2 match.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    there is no 'function' ... so code one yourself.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    60
    int Check2(char *Array,int Size){
    int i,j;
    for(i=0;i<Size-1;i++)
    for(j=Size-1;j>i;j--)
    if(Array[i]==Array[j])
    return 1;
    return 0;
    } /* End of Check2 */

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 11
    Last Post: 10-07-2008, 06:19 PM
  2. arrays vs lists? And containers in general!
    By clegs in forum C++ Programming
    Replies: 22
    Last Post: 12-03-2007, 02:02 PM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM