Array (seperate inputs by comma)

This is a discussion on Array (seperate inputs by comma) within the C Programming forums, part of the General Programming Boards category; I am new with C. what I am attempting to do is to ask for 2 names seperated by a ...

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Array (seperate inputs by comma)

    I am new with C. what I am attempting to do is to ask for 2 names seperated by a comma (ie. Smith, John). then trying to cout them as (John Smith). I have an idea but just have no clue how to write it...

    this is what I have so far...

    #include <stdio.h>
    #include <conio.h>
    #include <iostream.h>
    #include <string.h>

    main () {
    clrscr();

    char name[50];

    cout<<endl<<"Please enter your name (lastname, firstname): ";
    cin >>name;

    while (

    cout<<endl<<;

    cout<<endl<<"press any key to exit...";
    getch();

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    this is C++ not C

    and very outdated C++

    iostream.h should be replaced by iostream for example

    decide - what langauge you are lerning and update your compiler to some modern time one
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 11-25-2008, 12:50 AM
  2. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  3. Template Array Class
    By hpy_gilmore8 in forum C++ Programming
    Replies: 15
    Last Post: 04-11-2004, 11:15 PM
  4. two dimensional dynamic array?
    By ichijoji in forum C++ Programming
    Replies: 6
    Last Post: 04-14-2003, 04:27 PM
  5. Help with an Array
    By omalleys in forum C Programming
    Replies: 1
    Last Post: 07-01-2002, 08:31 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21