Category : stack-overflow

I am newbie in programming. I’ve found a program in which what’s use of fflush (stdin); that’s I don’t know and that’s program seems like: include<stdio.h> include<conio.h> int main() { char another; int num; do { printf (“Enter a number ”); scanf (“%d”, &num); printf (“square of %d is %dn”, num, num * num); printf ..

Read more

Take as input str, a string. Assume that value of a=1, b=2, c=3, d=4, …. z=26.Print all possible codes for the string. E.g. for “1123” possible codes are aabc, kbc, alc, aaw, kw. I tried to implement this ….. Here is my code…. #include<bits/stdc++.h> using namespace std; void helper(string str,int idx,string ans){ if(idx==str.length()){ cout<<ans<<","; return; ..

Read more

This is my code. When I run a programm it gives a stack overflow exception after "void tret(int* mas, int size, int left, int right){".I can’t get why and i’ve tried everything. What might be the reason? #include <iostream> #include <ctime> #define _CRT_SECURE_NO_WORNING using namespace std; void tret(int* mas, int size, int left, int right) ..

Read more