CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: _tcstok

  1. #1
    Join Date
    Mar 2004
    Posts
    9

    _tcstok

    Why does _tcstok return lower case?

  2. #2
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: _tcstok

    It highly depends on your input on what your output will be... So how do you call _tcstok()?
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  3. #3
    Join Date
    Mar 2004
    Posts
    9

    Re: _tcstok

    for example: the input string is "ROGER", the function returns: "roger".

  4. #4
    Join Date
    Mar 2004
    Location
    (Upper-) Austria
    Posts
    2,899

    Re: _tcstok

    Quote Originally Posted by MSDN
    Returns a pointer to the next token found in strToken. They return NULL when no more tokens are found. Each call modifies strToken by substituting a NULL character for each delimiter that is encountered.
    So can please give a full code of how you call your _tcstok() function?
    I am not offering technical guidiance via email or IM
    Come on share your photo with us! CG members photo album!
    Use the Code Tags!

  5. #5
    Join Date
    Mar 2004
    Posts
    9

    Re: _tcstok

    PTCHAR _getNextToken(void)
    {
    TCHAR theDelim[] = TEXT(" ");
    TCHAR quotedDelim[] = TEXT("\"");

    TCHAR *theToken = NULL;

    theToken = _tcstok(NULL, theDelim);
    if(theToken && theToken[0]==_T('"'))
    {
    theToken[_tcslen(theToken)] = _T(' ');
    theToken++; // skip the leading "

    _tcstok(NULL, quotedDelim); // Look for the trailing "
    }

    return theToken;
    }

  6. #6
    Join Date
    Mar 2004
    Posts
    9

    Red face Re: _tcstok

    Oops, I found a call to: _tcslwr(Command) before _tcstok. Sorry!

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