바로이순간의 공간

  • 홈
  • 태그
  • 방명록

getline 2

cin.getline 입력

#include<iostream> #include<string> #include<memory.h> #define BUF_SIZE 1024 using namespace std; int main() { char buf[BUF_SIZE]; string str; int menuNum; cout<<"숫자 입력: "; cin>>menuNum; cout<<"입력된 숫자 : "<<menuNum; cout<<endl<<"문자열 입력 "; // cin.clear(); cin.ignore(BUF_SIZE, '\n'); getline(cin, st..

c·c++/c++ 프로그래밍 2012.09.16

c++ cin>> 대신 사용하는 안전한 입력방식

#include <iostream> #include <string> #include <sstream> using namespace std; int main() { string input = ""; // How to get a string/sentence with spaces cout << "Please enter a valid sentence (with spaces):\n>"; getline(cin, input); cout << "You entered: " << input << endl << endl; // How to get a number. int myNumb..

c·c++/c++ 프로그래밍 2011.12.03
이전
1
다음
더보기
프로필사진

바로이순간의 공간

  • 분류 전체보기 (542)
    • 알고리즘, 자료구조 (27)
      • 자료구조 (11)
      • 알고리즘 (16)
    • Blockly webc (10)
      • Blockly webc (5)
      • svl에 대하여 (5)
    • c·c++ (357)
      • c 프로그래밍 (314)
      • c++ 프로그래밍 (43)
    • 자바·파이썬·자바스크립트 (35)
      • 파이썬 프로그래밍 (17)
      • Java 프로그래밍 (9)
      • 자바스크립트 (9)
    • 기타 (102)
      • 컴퓨터공학 (63)
      • 과학 (4)
      • 수학 (11)
      • 번역 (24)

Tag

CIN, 피보나치 수열, 행렬의 곱셈, c언어 독학, 순환호출, 애너그램, 진법변환, 단어세기, 자바스크립트, 재귀호출,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바