Problem with CString.Format

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jun 2008
Posts: 20
Reputation: angelsherin is an unknown quantity at this point 
Solved Threads: 0
angelsherin angelsherin is offline Offline
Newbie Poster

Problem with CString.Format

 
0
  #1
Jul 9th, 2008
Hi friends,
Kindly help me in this...i have to print the values of input and languagepair
i tried this first

CString Add(CString input,CString languagePair)
{
CString url ;
url.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text= %s &langpair= %s ", input, languagePair);
}
i got error
then i tried this
CString Add(CString input,CString languagePair)
{
CString url ;
url.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text= {0}&langpair= {0} ", input, languagePair);
}
Thanks in advalce...sherin
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 18
Reputation: Aashath is an unknown quantity at this point 
Solved Threads: 5
Aashath's Avatar
Aashath Aashath is offline Offline
Newbie Poster

Re: Problem with CString.Format

 
0
  #2
Jul 9th, 2008
Originally Posted by angelsherin View Post
Hi friends,
Kindly help me in this...i have to print the values of input and languagepair
i tried this first

CString Add(CString input,CString languagePair)
{
CString url ;
url.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text= %s &langpair= %s ", input, languagePair);
}
i got error
then i tried this
CString Add(CString input,CString languagePair)
{
CString url ;
url.Format("http://www.google.com/translate_t?hl=en&ie=UTF8&text= {0}&langpair= {0} ", input, languagePair);
}
Thanks in advalce...sherin

Could be little bit clear in explaining the error. i tried compiling your code and it works Perfect in my VC6.0 Compiler.
"The most important single aspect of software development is to be clear about what you are trying to build." - Bjarne Stroustrup
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC