CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2010
    Posts
    3

    How to split string into char array

    Hello!
    I have to input Full Name in a char with no more than 50 symbols then I have to split it into 3 chars - First Name, Second Name and Family Name. I've tried so hard but I was not able to get to solution so I decided to ask here. I hope you will help me!

    Thanks!

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: How to split string into char array

    1. Did you ever work with arrays?
    2. Did you ever work with char arrays?
    3. Is there a particular reason to not use MFC CString or STL std::string classes?
    4. Do you know in what format you get in input Full Name string?
    5. Did you try to search MSDN for C-runtime string functions?
    6. ...
    Victor Nijegorodov

  3. #3
    Join Date
    May 2010
    Posts
    3

    Re: How to split string into char array

    Thanks! I see that I won't find any help or any kind of direction...
    I'm noob... I've searched so much in google but I didn't find anything which could help me. I thought that I would receive a little bit of help but no...
    Everyone is too smart to help the noob ones... Bye, I won't spam your forum!

  4. #4
    Join Date
    May 2010
    Posts
    3

    Re: How to split string into char array

    ***?! Deleting posts... I got it! Please delete this thread and my profile!

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: How to split string into char array

    Quote Originally Posted by Seishin View Post
    Thanks! I see that I won't find any help or any kind of direction...
    I'm noob... I've searched so much in google but I didn't find anything which could help me. I thought that I would receive a little bit of help but no...
    Everyone is too smart to help the noob ones... Bye, I won't spam your forum!
    Feel better? Victor asked some reasonable questions. I don't see anything for you to get offended or defensive about. Sometimes more information is needed before help can be provided.

    In questions 1 and 2, Victor is trying to gauge your level of experience so as to properly word his answer.

    Question 3 is asking about classes that make the task easier.

    The solution depends on the answer to question 4,

    5, can help determine if you know what documentation is out there and steer you towards it if you don't.

    That's all reasonable.
    Last edited by GCDEF; May 26th, 2010 at 02:16 PM.

  6. #6
    Join Date
    Jan 2002
    Location
    Houston, TX
    Posts
    1,421

    Re: How to split string into char array

    VictorN's response is a good starting point so we can understand what you do or do not know.

    Your attitude will not get you far on this (or most) forums when people who respond to you are willing to help (but remember they are donating their time), and are trying to gather information.

    It also is very useful (and mentioned in the posting guidelines) to show the code you've already written and point out specifically where you are having a problem.
    Be sure to rate those who help!
    -------------------------------------------------------------
    Karl - WK5M
    PP-ASEL-IA (N43CS)
    PGP Key: 0xDB02E193
    PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

  7. #7
    Join Date
    Aug 2008
    Posts
    902

    Re: How to split string into char array

    Quote Originally Posted by Seishin View Post
    Hello!
    I have to input Full Name in a char with no more than 50 symbols then I have to split it into 3 chars - First Name, Second Name and Family Name. I've tried so hard but I was not able to get to solution so I decided to ask here. I hope you will help me!

    Thanks!
    http://www.cplusplus.com/reference/string/string/

    Read about string::substr() and string::find_first_of()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured