Problem with strings


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem with strings

  1. #1
    Join Date
    Dec 2004
    Location
    Porto - Portugal
    Posts
    42

    Angry Problem with strings

    Hello,

    I'm doing a program where I'm getting an annoying error; here's a sample:

    Code:
    WCHAR GuidString[39] = { 0 };
    unsigned int i, k;
    std::string str;
    //Code goes here without errors
    
    str.append("  InterfaceGUID[%d]:\t %ws\n", i, GuidString);
    In this LAST line I get the constant error:

    1>.\test.cpp(84) : error C2664: 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::append(const std::basic_string<_Elem,_Traits,_Ax> &,unsigned int,unsigned int)' : cannot convert parameter 3 from 'WCHAR [39]' to 'unsigned int'

    Does anyone has a clue how I can fix this?

    Regards,

    Kepler

  2. #2
    Join Date
    Jul 2014
    Posts
    7
    You are trying to pass a single char instead ("Letter"). The error is saying that there is no version of replace() that takes a char as the 3rd parameter.

Similar Threads

  1. Replies: 16
    Last Post: 07-18-2005, 07:15 PM
  2. Replies: 13
    Last Post: 04-04-2005, 03:13 AM
  3. problem in the displaying two strings
    By abhit_kumar in forum Java
    Replies: 0
    Last Post: 03-15-2005, 05:05 AM
  4. Problem with Strings
    By token in forum Java
    Replies: 4
    Last Post: 03-19-2004, 01:43 PM
  5. problem in query when comparing strings
    By anonymous in forum VB Classic
    Replies: 1
    Last Post: 03-20-2003, 02:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center