그래서 C 나 자신을 가르치고 ++와 내가 잘못 여기에 무엇을 볼 수 없습니다 두 배로 :코드 출력이
코드 :
// Arrays.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
int i = 0;
char input = ' ';
for(i = 1; i <= 100; ++i)
{
std::cout << "enter a value for element number " << i << ": " ;
do
{
input = std::cin.get();
std::cout << "recorded element in position " << i << " is " << input << "\n";
} while (!input == 'q') ;
}
}
문제 :
라인 17 : 입력 std::cin.get();
그것은 내게 이것을 준다 : recorded element in position
2
소자의 수에 대한 값을 입력이다 5 recorded element in position 1
소자 번호 (2)에 대한 값을 입력 5 : IT와 기록 자동
소자의 숫자 값을 입력 저 소자 (2)를 완성 3 :
하지만 std::cin >> input
으로 바꾸면 왜 안 되죠?