Sponsored Content
Full Discussion: Why can't I use string.h?
Top Forums Programming Why can't I use string.h? Post 53880 by Mastermind on Tuesday 27th of July 2004 03:51:39 PM
Old 07-27-2004
I am sure <string> is part of the C++ STL and is
not in C at all.

In C a string is const char* that is why <string> has
the c_str() function.
Mastermind
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search string in a file and retrieve 10 lines including string line

Hi Guys, I am trying to write a perl script to search a string "Name" in the file "FILE" and also want to create a new file and push the searched string Name line along with 10 lines following the same. can anyone of you please let me know how to go about it ? (8 Replies)
Discussion started by: sukrish
8 Replies

2. Shell Programming and Scripting

replace (sed?) a string in file with multiple lines (string) from variable

Can someone tell me how I can do this? e.g: a=$(echo -e wert trewt ertert ertert ertert erttert erterte rterter tertertert ert) How do i replace the STRING with $a? I try this: sed -i 's/STRING/'"$a"'/g' filename.ext but this don' t work (2 Replies)
Discussion started by: jforce
2 Replies

3. Shell Programming and Scripting

to extract string from main string and string comparison

continuing from my previous post, whose link is given below as a reference https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 consider there is create table commands in a file for eg: CREATE TABLE `Blahblahblah` ( `id` int(11) NOT NULL... (2 Replies)
Discussion started by: vivek d r
2 Replies

4. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

5. Shell Programming and Scripting

grep exact string from files and write to filename when string present in file

I am attempting to grep an exact string from a series of files within a directory and append that output to the filename when it is present in the file. I've been after this all day with no luck. Thanks for your help in advance :wall:. (4 Replies)
Discussion started by: JC_1
4 Replies

6. Shell Programming and Scripting

Remove lines between the start string and end string including start and end string Python

Hi, I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

7. Shell Programming and Scripting

Search a string in a text file and add another string at the particular position of a line

I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB and add/replace... (1 Reply)
Discussion started by: suryanarayana
1 Replies

8. Shell Programming and Scripting

Search a string in a text file and add another string at the end of line

Dear All I am having a text file which is having more than 200 lines. EX: 001010122 12000 BIB 12000 11200 1200003 001010122 2000 AND 12000 11200 1200003 001010122 12000 KVB 12000 11200 1200003 In the above file i want to search for string KVB... (5 Replies)
Discussion started by: suryanarayana
5 Replies

9. Shell Programming and Scripting

awk string comparison unterminated quoted string andrule of thumb

I have the logic below to look up for matches within the columns between the two files with awk. In the if statement is where the string comparison is attempted with == The issue seems to be with the operands, as 1. when " '${SECTOR}' " -- double quote followed by single quote -- awk matches... (1 Reply)
Discussion started by: deadyetagain
1 Replies

10. UNIX for Beginners Questions & Answers

Search a string and display its location on the entire string and make a text file

I want to search a small string in a large string and find the locations of the string. For this I used grep "string" -ob <file name where the large string is stored>. Now this gives me the locations of that string. Now how do I store these locations in a text file. Please use CODE tags as... (7 Replies)
Discussion started by: ANKIT ROY
7 Replies
std::collate< _CharT >(3cxx)											      std::collate< _CharT >(3cxx)

NAME
std::collate< _CharT > - SYNOPSIS
Inherits std::locale::facet. Inherited by std::collate_byname< _CharT >. Public Types typedef _CharT char_type typedef basic_string< _CharT > string_type Public Member Functions collate (size_t __refs=0) collate (__c_locale __cloc, size_t __refs=0) int _M_compare (const _CharT *, const _CharT *) const throw () template<> int _M_compare (const char *, const char *) const throw() template<> int _M_compare (const wchar_t *, const wchar_t *) const throw() size_t _M_transform (_CharT *, const _CharT *, size_t) const throw () template<> size_t _M_transform (char *, const char *, size_t) const throw() template<> size_t _M_transform (wchar_t *, const wchar_t *, size_t) const throw() int compare (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) const long hash (const _CharT *__lo, const _CharT *__hi) const string_type transform (const _CharT *__lo, const _CharT *__hi) const Static Public Attributes static locale::id id Protected Member Functions virtual ~collate () virtual int do_compare (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) const virtual long do_hash (const _CharT *__lo, const _CharT *__hi) const virtual string_type do_transform (const _CharT *__lo, const _CharT *__hi) const Static Protected Member Functions static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw () static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0) static void _S_destroy_c_locale (__c_locale &__cloc) static __c_locale _S_get_c_locale () static const char * _S_get_c_name () throw () static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s) Protected Attributes __c_locale _M_c_locale_collate Detailed Description template<typename _CharT>class std::collate< _CharT > Facet for localized string comparison. This facet encapsulates the code to compare strings in a localized manner. The collate template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the collate facet. Definition at line 618 of file locale_classes.h. Member Typedef Documentation template<typename _CharT> typedef _CharT std::collate< _CharT >::char_type Public typedefs. Definition at line 624 of file locale_classes.h. template<typename _CharT> typedef basic_string<_CharT> std::collate< _CharT >::string_type Public typedefs. Definition at line 625 of file locale_classes.h. Constructor &; Destructor Documentation template<typename _CharT> std::collate< _CharT >::collate (size_t__refs = 0) [inline], [explicit] Constructor performs initialization. This is the constructor provided by the standard. Parameters: refs Passed to the base facet class. Definition at line 645 of file locale_classes.h. template<typename _CharT> std::collate< _CharT >::collate (__c_locale__cloc, size_t__refs = 0) [inline], [explicit] Internal constructor. Not for general use. This is a constructor for use by the library itself to set up new locales. Parameters: cloc The C locale. refs Passed to the base facet class. Definition at line 659 of file locale_classes.h. template<typename _CharT> virtual std::collate< _CharT >::~collate () [inline], [protected], [virtual] Destructor. Definition at line 722 of file locale_classes.h. Member Function Documentation template<typename _CharT> int std::collate< _CharT >::compare (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) const [inline] Compare two strings. This function compares two strings and returns the result by calling collate::do_compare(). Parameters: lo1 Start of string 1. hi1 End of string 1. lo2 Start of string 2. hi2 End of string 2. Returns: 1 if string1 > string2, -1 if string1 < string2, else 0. Definition at line 676 of file locale_classes.h. template<typename _CharT> int std::collate< _CharT >::do_compare (const _CharT *__lo1, const _CharT *__hi1, const _CharT *__lo2, const _CharT *__hi2) const [protected], [virtual] Compare two strings. This function is a hook for derived classes to change the value returned. See Also: compare(). Parameters: lo1 Start of string 1. hi1 End of string 1. lo2 Start of string 2. hi2 End of string 2. Returns: 1 if string1 > string2, -1 if string1 < string2, else 0. Definition at line 136 of file locale_classes.tcc. References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), std::basic_string< _CharT, _Traits, _Alloc >::data(), and std::basic_string< _CharT, _Traits, _Alloc >::length(). template<typename _CharT> long std::collate< _CharT >::do_hash (const _CharT *__lo, const _CharT *__hi) const [protected], [virtual] Return hash of a string. This function computes and returns a hash on the input string. This function is a hook for derived classes to change the value returned. Parameters: lo Start of string. hi End of string. Returns: Hash value. Definition at line 231 of file locale_classes.tcc. template<typename _CharT> collate< _CharT >::string_type std::collate< _CharT >::do_transform (const _CharT *__lo, const _CharT *__hi) const [protected], [virtual] Transform string to comparable form. This function is a hook for derived classes to change the value returned. Parameters: lo1 Start of string 1. hi1 End of string 1. lo2 Start of string 2. hi2 End of string 2. Returns: 1 if string1 > string2, -1 if string1 < string2, else 0. Definition at line 175 of file locale_classes.tcc. References std::basic_string< _CharT, _Traits, _Alloc >::append(), std::basic_string< _CharT, _Traits, _Alloc >::c_str(), std::basic_string< _CharT, _Traits, _Alloc >::data(), std::basic_string< _CharT, _Traits, _Alloc >::length(), and std::basic_string< _CharT, _Traits, _Alloc >::push_back(). template<typename _CharT> long std::collate< _CharT >::hash (const _CharT *__lo, const _CharT *__hi) const [inline] Return hash of a string. This function computes and returns a hash on the input string. It does so by returning collate::do_hash(). Parameters: lo Start of string. hi End of string. Returns: Hash value. Definition at line 709 of file locale_classes.h. template<typename _CharT> string_type std::collate< _CharT >::transform (const _CharT *__lo, const _CharT *__hi) const [inline] Transform string to comparable form. This function is a wrapper for strxfrm functionality. It takes the input string and returns a modified string that can be directly compared to other transformed strings. In the C locale, this function just returns a copy of the input string. In some other locales, it may replace two chars with one, change a char for another, etc. It does so by returning collate::do_transform(). Parameters: lo Start of string. hi End of string. Returns: Transformed string_type. Definition at line 695 of file locale_classes.h. Referenced by std::regex_traits< _Ch_type >::transform(). Member Data Documentation template<typename _CharT> locale::id std::collate< _CharT >::id [static] Numpunct facet id. Definition at line 635 of file locale_classes.h. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ Tue Nov 27 2012 std::collate< _CharT >(3cxx)
All times are GMT -4. The time now is 09:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy