c++ - std::cout not printing the value with out endl (newline specifier) -
below c++ program multiply 2 strings (integers in strings) , produce integer result in string. believe due cout flush problem. can explain how print value without endl or text string before printing answer. #include <iostream> using namespace std; string multiply (string s1, string s2) { char str[10]; string ans=""; int m=s1.length(); int n=s2.length(); if (!s1.compare("0") || !s2.compare("0")) return "0"; int *res = new int[m + n]; (int = m - 1; >= 0; i--) { (int j = n - 1; j >= 0; j--) { res[m + n - - j - 2] += (s1[i] - '0') * (s2[j] - '0'); res[m + n - - j - 1] += res[m + n - - j - 2] / 10; res[m + n - - j - 2] %= 10; } } (int = m + n - 1; >= 0; i--) { if (res[i] != 0) { (int j = i; j >= 0; j--) { ...