'c++'에 해당되는 글 4건

  1. 2013.03.12 C/C++ link
  2. 2013.02.13 convert int to string in c++
  3. 2013.02.01 c++ string replace
  4. 2012.05.15 C, C++ reference

C/C++ link

ITWeb/개발일반 2013.03.12 13:01

http://publib.boulder.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.cbc%2Fcbc.htm

신고

'ITWeb > 개발일반' 카테고리의 다른 글

apache so module guide.  (0) 2013.03.19
PDF 생성라이브러리  (0) 2013.03.19
C/C++ link  (0) 2013.03.12
C++ nano time  (0) 2013.03.12
TFIDF  (0) 2013.02.19
struct timeb example.  (0) 2013.02.13
tags : c, c++
Trackback 0 : Comment 0

convert int to string in c++

ITWeb/개발일반 2013.02.13 13:49

Reference URL : http://www.cplusplus.com/articles/D9j2Nwbp/


[Convert int to string]

int convInt;

stringstream convStr;

string str;


convInt = 1024;

convStr << convInt;


str = convStr.str();


신고

'ITWeb > 개발일반' 카테고리의 다른 글

TFIDF  (0) 2013.02.19
struct timeb example.  (0) 2013.02.13
convert int to string in c++  (0) 2013.02.13
caution using zlib & cryptopp  (0) 2013.02.12
check qmail & dovecot version.  (0) 2013.02.05
encryption algorithm link scrap.  (0) 2013.02.05
tags : c++, int to string
Trackback 0 : Comment 0

c++ string replace

ITWeb/개발일반 2013.02.01 13:08

[Reference URL]
http://www.cplusplus.com


The below code is valid on my machine.

str_vector_t sReplVector;

str_vector_const_iterator_t sIterator;

std::string findStr = "";

int32_t pos = 0;


for ( sIterator = sQueryVector1.begin(); sIterator != sQueryVector1.end(); sIterator++ ) {

    findStr = sIterator->c_str();

    pos = findStr.find("INSERT INTO Tbl1");

    LOGDEBUG("[ASIS][sQueryVector1][%s]", sIterator->c_str());


    if ( pos > 0 ) {

        findStr.replace(pos, 17, "INSERT INTO Tbl2");

        sReplVector.push_back(findStr);

        LOGDEBUG("[TOBE][sQueryVector1][%s]", findStr.c_str());

    }

}


General example by cpluscplus.com
http://www.cplusplus.com/reference/string/string/replace/

// replacing in a string

#include <iostream>
#include <string>

int main ()
{
  std::string base="this is a test string.";
  std::string str2="n example";
  std::string str3="sample phrase";
  std::string str4="useful.";

  // replace signatures used in the same order as described above:

  // Using positions:                 0123456789*123456789*12345
  std::string str=base;           // "this is a test string."
  str.replace(9,5,str2);          // "this is an example string." (1)
  str.replace(19,6,str3,7,6);     // "this is an example phrase." (2)
  str.replace(8,10,"just a");     // "this is just a phrase."     (3)
  str.replace(8,6,"a shorty",7);  // "this is a short phrase."    (4)
  str.replace(22,1,3,'!');        // "this is a short phrase!!!"  (5)

  // Using iterators:                                               0123456789*123456789*
  str.replace(str.begin(),str.end()-3,str3);                    // "sample phrase!!!"      (1)
  str.replace(str.begin(),str.begin()+6,"replace");             // "replace phrase!!!"     (3)
  str.replace(str.begin()+8,str.begin()+14,"is coolness",7);    // "replace is cool!!!"    (4)
  str.replace(str.begin()+12,str.end()-4,4,'o');                // "replace is cooool!!!"  (5)
  str.replace(str.begin()+11,str.end(),str4.begin(),str4.end());// "replace is useful."    (6)
  std::cout << str << '\n';
  return 0;
}


신고

'ITWeb > 개발일반' 카테고리의 다른 글

AES Encrypt/Decrypt using cryptopp(crypto++)  (0) 2013.02.05
C++ file read/write as buffer size  (0) 2013.02.01
c++ string replace  (0) 2013.02.01
default gcc, g++ compile command  (0) 2013.01.31
make options  (0) 2013.01.28
gerrit 링크  (0) 2013.01.22
tags : c++, replace, String, Vector
Trackback 0 : Comment 0

C, C++ reference

ITWeb/개발일반 2012.05.15 17:34

[원본링크]


C, C++ API Doc 정리가 잘되어 있내요.

이제 C, C++ 도 해야 하는군..;;;

신고

'ITWeb > 개발일반' 카테고리의 다른 글

[Cubrid] cci example code  (0) 2012.05.22
[C Program] curl example code.  (0) 2012.05.22
C, C++ reference  (0) 2012.05.15
알고리즘 - O(log N) ...  (0) 2012.05.10
정규표현식 가이드 (펌)  (0) 2012.05.04
MongoDB - Strategies when hitting disk  (0) 2012.05.03
tags : c, c++
Trackback 0 : Comment 0