monstercameron
Well-Known Member
lets use this post so we can post code and get other members to help us troubleshoot.
i am practicing some c++ before i attempt to start game programming. Any tips,tricks,advice or anything positive would be appreciated
i am practicing some c++ before i attempt to start game programming. Any tips,tricks,advice or anything positive would be appreciated
Code:
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int primero;
int segundo;
string operation;
string whatnext;
int active;
int main()
{
while(active == 1)
{
cout << "Hello world!" << endl;
cout << "Welcome to Calc++" << endl;
cout << "enter unit" << endl;
cin >> primero ;
cout << "enter operation" << endl;
cin >> operation ;
cout << "enter unit" << endl;
cin >> segundo ;
if (operation == "+")
cout << primero + segundo << endl;
if (operation == "-")
cout << primero - segundo << endl;
if (operation == "x")
cout << primero * segundo << endl;
if (operation == "/")
cout << primero / segundo << endl;
cout << "what's next" << endl;
cin >> whatnext;
if (whatnext = "quit")
active = 0;
system("pause");
system("clear");
}
return 0;
}