Thread: Pointers and arrays

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    2

    Pointers and arrays

    I'm trying to create a program that asks for 2 names and a number. Make sure both names have AT LEAST as many characters as the number. Example Thomas Ralph 4 This is OK because Thomas and Ralph have at least 4 characters in them. If its not OK ask for another number. Switch the letters from both names up to the number. Using the previous example Remove the Thom from Thomas and replace it with Ralp from Ralph giving you Ralpas. Remove the Ralp from Ralph and replace it with Thom from Thomas giving you Thomh, and then print out the names after they have been switched.

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    It seems you understand the algorithm, but what is the question?

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. Pointers and multi dimensional arrays
    By andrea72 in forum C++ Programming
    Replies: 5
    Last Post: 01-23-2007, 04:49 PM
  3. Passing pointers to arrays of char arrays
    By bobthebullet990 in forum C Programming
    Replies: 5
    Last Post: 03-31-2006, 05:31 AM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM
  5. Help understanding arrays and pointers
    By James00 in forum C Programming
    Replies: 2
    Last Post: 05-27-2003, 01:41 AM