J
J
jackroll2014-06-13 17:16:48
C++ / C#
jackroll, 2014-06-13 17:16:48

Where did I go wrong?

#include <iostream>
#include <conio.h>
#include <iomanip>

using namespace std;

const int cmdcolor = system("color 02");


int main() {
  setlocale(LC_ALL, "Russian");
  char choose;
  while (choose == 'n') {
    cout << "Продолжить? y/n";
    choose = _getch();
  }
  cout << "Вы успешно закрыли программму";
  _getch();
  return 0;
}

Compiling error: Error 1 error C4700: uninitialized local variable 'choose'
Where did I go wrong?
P.S. this is C++

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Pronin, 2014-06-13
@jackroll

initialize the variable.
char choose;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question