Solved

Localization : Is CString::Left() function safe?

Posted on 2000-03-05
2
272 Views
Last Modified: 2007-12-19
If I am writing a UNICODE app, is it safe to use the CString Left() function (i.e. CString s = x.Left(5) where x is also a CString with a value in it?

Or do I need to do something like: s = x.Left(5 * sizeof(TCHAR))

Thanks.
0
Comment
Question by:rascal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
mnewton022700 earned 100 total points
ID: 2586371
It is definitely safe. I've worked with CString under UNICODE for quite some time and have never had any problems.

Left extracts the given number of characters whether they be TCHARs or simply chars.

0
 

Expert Comment

by:Pyr0
ID: 8018799
I used the Left function and it did not extract anything... it returned the entire word!! ?????
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question