seperate strings

This is a discussion on seperate strings within the C Programming forums, part of the General Programming Boards category; Dear All, I have a char array = "ashok:id:mobile" now I wanna store "ashok" into a[], "id" into b[] and ...

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    32

    seperate strings

    Dear All,

    I have a char array = "ashok:id:mobile"

    now I wanna store "ashok" into a[], "id" into b[] and "mobile" into c[], how can i do that ?


    Thanks in advance ....

    -Ashok

  2. #2
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    You can use strtok()
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strings Program
    By limergal in forum C++ Programming
    Replies: 4
    Last Post: 12-02-2006, 02:24 PM
  2. Problem with Strings, Please help!
    By varus in forum C++ Programming
    Replies: 8
    Last Post: 11-27-2006, 10:47 PM
  3. Programming using strings
    By jlu0418 in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2006, 07:07 PM
  4. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 06:37 AM
  5. menus and strings
    By garycastillo in forum C Programming
    Replies: 3
    Last Post: 04-29-2002, 11:23 AM

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