Strings

This is a discussion on Strings within the C++ Programming forums, part of the General Programming Boards category; I would really like to know if it is possible, (if so, how?) to split a string into a char ...

  1. #1
    Unregistered
    Guest

    Smile Strings

    I would really like to know if it is possible, (if so, how?) to split a string into a char variable, i know how to split the integers in a string to an int variable, but i would like to be able to validate words without validating each character from the string!
    Please help. thanks
    <a href="mailto:robit@i4free.co.nz">email</a>

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Well a string is actually an array of char's. I don't know if that helps you much.

  3. #3
    Unregistered
    Guest
    char s[]="mystring";
    char myChar=s[0]; // of course the index can be 0 to strlen(s)-1

    But I think what you're saying is this : changing an entire string and placing its contents into a char variable, and that simply isn't possible. The string is comprised of characters, that's like fitting several oranges into one.

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. Programming using strings
    By jlu0418 in forum C++ Programming
    Replies: 5
    Last Post: 11-26-2006, 07:07 PM
  3. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 06:37 AM
  4. damn strings
    By jmzl666 in forum C Programming
    Replies: 10
    Last Post: 06-24-2002, 02:09 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