Thread: Help with strings and pointers

  1. #1
    Unregistered
    Guest

    Help with strings and pointers

    help please, i don't know why this doesn't work, what i am trying to do it when it is case 'f', it will get the names from the command line that the user entered like "hw6 -f john smith 10/21/2002 the rock 02/19/2000" then get the word john smith and the rock and capitalize the first letter of the word and print them.

    case 'f':

    c = argv[x];
    while (c != '\0')

    {

    lastname [a] = argv[x+1];
    firstname [b] = argv[x];

    a++;
    b++;

    printf ("last name is %s and first name is %s", lastname , firstname);

    c = argv [x+3];

    }

    break;

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Please don't start a new thread with the same question. If you are patient, the answer will come.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Unregistered
    Guest

    Unhappy

    sorry, but i just couldn't figure out

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with calloc and pointers to strings.
    By sweetarg in forum C Programming
    Replies: 1
    Last Post: 10-24-2005, 02:28 PM
  2. Arrays, pointers and strings
    By Apropos in forum C++ Programming
    Replies: 12
    Last Post: 03-21-2005, 11:25 PM
  3. Concatenating strings (dynamic array using pointers)
    By Tankndozer in forum C Programming
    Replies: 8
    Last Post: 07-01-2004, 07:27 AM
  4. hangman need help with strings and pointers
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 03-27-2002, 09:13 AM
  5. need more help with pointers and strings
    By bgbfflochp in forum C++ Programming
    Replies: 11
    Last Post: 03-19-2002, 08:31 AM