Hi,
I'm just trying out something with returning values to a variable and I've encountered a problem.
Basically the program is supposed to return the value of
string x
as either true or false from the
isEven
function, then the
void output
function should output the value of
string x
The problem is that at line 8, my IDE says,
ERROR: expected a declaration
The code :
#include "stdafx.h"
#include "stdio.h"
#include <iostream>
using namespace std;
void output {
cout << x;
cin.get();
}
string IsEven(string x)
{
if ( 100 / 3 % 2 == 0 ) return "even";
else return "odd";
}