Install CLion on ubuntu. After running the code, it often displays incorrect values. It is necessary to run the code several times so that it gives the entire answer. For example: I created an array of 10 elements and filled it with random values, displayed it through a loop on the screen. In theory, everything is correct, but often not all numbers are output, and in order to achieve full array output, you must run the code several times. This problem does not apply only to arrays. Checked through debugger, everything works fine, but when I display on the screen, often the information is not correct. 
#include "iostream" #include "ctime" using namespace std; void bubbleSort(int *arr, int size) { int tmp, i, j; for (i = 0; i < size - 1; ++i) // i - номер прохода { for (j = 0; j < size - 1; ++j) // внутренний цикл прохода { if (arr[j + 1] < arr[j]) { tmp = arr[j + 1]; arr[j + 1] = arr[j]; arr[j] = tmp; } } } } int main() { int* N = new int; cin >> *N; int * pArray = new int[*N]; srand((unsigned int)time(NULL)); for(int i = 0; i < *N; i++) { pArray[i] = 1 + rand() % 100; cout << pArray[i] << endl; } bubbleSort(pArray, *N); for (int j = 0; j < *N; j++) { cout << pArray[j] << " "; } delete [] pArray; return 0; }