Boost logo

Boost Users :

Subject: Re: [Boost-users] string comparison
From: Igor R (boost.lists_at_[hidden])
Date: 2010-02-10 08:55:11


> What is an example of function that does not expect null terminated strings?? there is not some function like where i can pass too
> the lenght of the string , something like datos2=(buf2.data,lenght)? thanks

In CRT you've got strcmp() that compares null-terminated C strings and
strncmp() which accept the number of characters to compare.
Besides, you can create std::string from n characters:
std::string s(your_c_string, n);
then you can compare std::string's with operator ==.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net