공순이의 블로그

고정 헤더 영역

글 제목

메뉴 레이어

공순이의 블로그

메뉴 리스트

  • 홈
  • 태그
  • 방명록
  • 분류 전체보기 (109)
    • 머신러닝 (13)
    • 파이썬 (26)
    • cmd (3)
    • terminal (22)
    • Pandas (1)
    • rviz (1)
    • c++ (8)
    • 문서 (4)
    • tensorflow (2)
    • Cakewalk (1)
    • IT 용어 (1)
    • PyTorch (3)
    • photoshop (1)
    • VSCode (2)
    • 3D Printing (1)
    • java (2)
    • OpenGL (1)
    • git (2)
    • MSYS2 (1)
    • React (0)
    • Mesh Segmentation (0)

검색 레이어

공순이의 블로그

검색 영역

컨텐츠 검색

stringstream

  • Int to string, string to char* in c++

    2020.07.19 by Riella

  • Stringstream: cuts the string into parts by space

    2020.07.19 by Riella

Int to string, string to char* in c++

#include #include #include #include using namespace std; int main() { char* arr [10]; int count = 0; string inp; //stringstream ss;

c++ 2020. 7. 19. 20:47

Stringstream: cuts the string into parts by space

Stringstream gets the input of string (line). Then it cuts based on space. I used it when getting rows of integer in one line, cut by one number(formatted in string) using stringstream, and changed into int using atoi( [name_of_string].c_str()) using a while loop. I used atoi( [].c_str) because the version of c++ was below 11. This is the sample code: #include #include #include //for stringstrea..

c++ 2020. 7. 19. 00:54

추가 정보

인기글

최신글

페이징

이전
1
다음
TISTORY
공순이의 블로그 © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바