Dividing sentence into words

This is a discussion on Dividing sentence into words within the C Programming forums, part of the General Programming Boards category; I have a sentence in a char array and want to parse it and divide it on the basis of ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    38

    Dividing sentence into words

    I have a sentence in a char array and want to parse it and divide it on the basis of spaces,each word got assigned to a specific array.How can I do that?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    Try searching for previous posts on strtok
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dividing a string to words
    By bahada in forum C Programming
    Replies: 15
    Last Post: 04-21-2009, 06:54 AM
  2. Begginer Problem: Extracting words from sentence
    By barlas in forum C++ Programming
    Replies: 5
    Last Post: 05-04-2006, 03:17 PM
  3. New Theme
    By XSquared in forum A Brief History of Cprogramming.com
    Replies: 160
    Last Post: 04-01-2004, 07:00 PM
  4. Searching for words within a sentence
    By drdroid in forum C++ Programming
    Replies: 4
    Last Post: 02-26-2003, 11:09 PM

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