i want it to get the input and split it up to 3 and save them as 3 strings help me please! the cout and cin at the end of the numbers function are here to help me check if it ran correctly at the moment if i do 123 + 890 it says 3 press enter to continue.
// Calculater.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int input, num1, num2, Length, op, i, result, useless;
int numbers(string input, int Length)
{
i = 0;
string op;
string num1;
string num2;
while (input.substr(i, 1).compare(" ") == 0 && i != Length)
{
i++;
num1 = input.substr(0, i);
}
i = i + 2;
op = input.substr(i, 1);
while (input.substr(i, 1).compare(" ") == 0 && i != Length)
{
num2 = input.substr(0, i);
i++;
}
cout << "\n" << num1 << " " << op << " " << num2;
cin >> useless;
return 0;
}
int main()
{
string input;
cout << "Calculator\nBy Matt Y-J!\n\n";
cout << "Equation:";
cin >> input;
Length = input.length();
numbers(input, Length);
system("pause");
return 0;
}