0
In this practicle i am unable to find values in one and two
#include <iostream> using namespace std; #include <string> int main() { string num; cin>>num; string b; cout <<" enter number"; cin >> b; int a; cout << "enter index"; cin >> a; int cnt = int(b.length()); int index = num.find(b); string one="", two=""; for(int i = index; i < index + cnt; i++) { num[i] =' '; } for(int i = 0; i < a; i++) { one[i] = num[i]; } for(int i = a; i < int(num.length()); i++) { two[i - a] = num[i]; } string new1 = ""+ one + b + two; cout << num; }
1 Réponse
+ 1
Not getting the flow. Can you describe or illustrate what the code should actually do?