If you had this code and it didnt work than thats fine but let me post it in case you missed something:
Addendum:
I think i'll be getting the compiler your using to have a go at it myself when I get the chance. Right now I've really been trying to help you based off knowledge alone that I already have programming in VB, though both of us trying to learn C++ at the same time isn't helping.
When times get tough, browse through a couple of code examples on the net to see how stuff is done. I've been doing that quite often lately...
#include <iostream>
using namespace std;
int main()
{
static int a = 4 * 6; // (Note use of comments and of semicolon) a is 24
static int b = a + 5; // b equals the original value of a with five added to it
cout<<"Please enter letter 'a' or 'b': ";
static const char inputstring = cin.get(); // imputstring equals the imput by the user, which is in this case, 'a' or 'b'
if (inputstring="a") {
cout<<"You entered 'a' which equals: "<< a <<endl;
} else if inputstring="b") {
cout<<"You entered 'b' which equals: "<< b <<endl;
} else {
cout<<"This program only accepts 'a' or 'b' as input"<<endl;
}
}
Addendum:
I think i'll be getting the compiler your using to have a go at it myself when I get the chance. Right now I've really been trying to help you based off knowledge alone that I already have programming in VB, though both of us trying to learn C++ at the same time isn't helping.
When times get tough, browse through a couple of code examples on the net to see how stuff is done. I've been doing that quite often lately...
Last edited: