How to get a part of a string from a point onwards

This is a discussion on How to get a part of a string from a point onwards within the C Programming forums, part of the General Programming Boards category; Hey all, I've been trying to think of a way to extract a part of a string from a position ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    10

    Question How to get a part of a string from a point onwards

    Hey all,

    I've been trying to think of a way to extract a part of a string from a position to the end of the string, and I can't figure out how.
    For example

    Zthis is is the part of the string i want not including the first letter

    so, i need to extract the whole sentence, without Z and store it in a variable.
    How do i do this?

    Thanks

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,414
    I've been trying to think of a way to extract a part of a string from a position to the end of the string, and I can't figure out how.
    You can use say, strcpy(dest, source + n), where n is the position.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    Thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. String and Floating Point Conversion Help
    By dfghjk in forum C++ Programming
    Replies: 14
    Last Post: 05-04-2008, 12:11 PM
  2. String issues
    By The_professor in forum C++ Programming
    Replies: 7
    Last Post: 06-12-2007, 09:11 AM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 10:03 PM
  4. Program using classes - keeps crashing
    By webren in forum C++ Programming
    Replies: 4
    Last Post: 09-16-2005, 03:58 PM
  5. Another overloading "<<" problem
    By alphaoide in forum C++ Programming
    Replies: 18
    Last Post: 09-30-2003, 10:32 AM

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