Results 1 to 2 of 2

Thread: How to split the char* with the token??

  1. #1
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to split the char* with the token??

    How to split the char* with the token?? in the following code::

    Qt Code:
    1. token = strtok_s( (char*)strbuff, "_", &nextToken );
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to split the char* with the token??

    Use QString::split.

    Qt Code:
    1. QString mystring (strbuff);
    2. QStringList tokens = mystring.split("_");
    To copy to clipboard, switch view to plain text mode 
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. Replies: 7
    Last Post: 6th February 2017, 19:10
  2. expected `)' before '*' token
    By vinod sharma in forum Qt Programming
    Replies: 3
    Last Post: 15th March 2010, 07:57
  3. expected initializer before »)« token
    By Holy in forum Qt Programming
    Replies: 2
    Last Post: 24th May 2008, 16:24
  4. char to const char* with atof
    By mickey in forum General Programming
    Replies: 5
    Last Post: 29th February 2008, 04:10
  5. setVisible, -> token, problems
    By Salazaar in forum Newbie
    Replies: 25
    Last Post: 12th June 2007, 14:30

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.