Stuck with my code for uni

Hello I am practising for uni using bloodshed and I keep getting an error on line 24 saying ' 25 C:\C++\test do while\test do while.cpp expected `;' before string constant

Im new to this and our assignment is to make a calculator that will calculate the circumfence of a circl and a few other things, nut for now I am justtrying out a few basic things I really need to understand everything about it!

Hope someone can point me in the right direction.

Many thanks

Robin

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  #include <cstdlib>
#include <iostream>
#include <math.h>

using namespace std;



int main(int argc, char *argv[])
{

int a;
int one = 1;
int two = 2;
int three = 3;
int four = 4;
int five = 5;

cout << "enter a number, press zero to exit\n";


cin >> a;

if (a = one) {
             cout "you pressed one";
             }            


}         


Last edited on
The error you're getting is because you've missed out the operator in line 25.

I'm surprised your compiler hasn't warned you about line 24. Can you see what's wrong there?
Aghhhh its the '<<' maaan im so dumb!!!


Many thanks mate...got a smile on my face now!!!

Nothing popping up about line 24 though


Cheers



Robin
Last edited on
line 24 hint - there's a difference between assignment operator and equality operator
Should it be == ?

Cheers

Robin
You got it :)
Thanks very much guys, really appreciate it


Robin
Topic archived. No new replies allowed.