473,320 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C2143 syntax errror

Hi I made a code and i am getting the same error no matter what I do to try and fix it here it is and the line it is happening on

1>c:\documents and settings\administrator\my documents\visual studio 2005\projects\hw3\hw3\hw3.cpp(46) : error C2143: syntax error : missing ';' before '.'
1>c:\documents and settings\administrator\my documents\visual studio 2005\projects\hw3\hw3\hw3.cpp(50) : error C2143: syntax error : missing ';' before '.'


Expand|Select|Wrap|Line Numbers
  1. 46:SACyl = Circumfrence*CylHeight + PI*TankRadius*TankRadius;
  2. 47:    if(SACyl > 200)
  3. 48:    {
  4. 49:        double CylCost1 = (SACyl-200.0);
  5. 50:        double CylCostD = ((CylCost1*300.0)*0.1);
  6. 51:        double CylCost2 = (CylCost1*300.0)-CylCostD;
  7. 52:        double MyTank.CylCost = (200.0*300.0)+CylCost2;
  8. 53:    }
  9.  
can someone please help me its been driving me crazy
Sep 4 '07 #1
2 1513
RRick
463 Expert 256MB
It looks like the compiler is pissed about the '.' in PI and in the 0.1 constant on line 50. I can't see any problems with these particular lines.

Double check the definition of PI. If PI looks good, then something has caused the problem before line 46. Its probably an extra or misplaced '(' or perhaps an '.' These can be tricky to find.

My suggestion is to temporarily remove the offending lines of code and see if this fixes the problem. If you have a misplaced character, then the problem will show up laterin your code. I've had times where I had to remove hundreds of lines of code to find a misplaced chararcter.
Sep 4 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
46:SACyl = Circumfrence*CylHeight + PI*TankRadius*TankRadius;

1>c:\documents and settings\administrator\my documents\visual studio 2005\projects\hw3\hw3\hw3.cpp(46) : error C2143: syntax error : missing ';' before '.'
There is no . in line 46.

All this error says is that by the time the compiler got to line 46, it was in trouble. There actual error may bhave nothing to do with a dot. Look earlier in the code, like line 45 and up.

Also, you don't show the definitions of your variables in line 46.
Sep 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rhodrey | last post by:
I have the following code: #include <iostream> #include <fstream> #include <string> #include <iomanip> #include <cstdlib> #include <conio.h> #include "stdinfo.h"
11
by: Florian Liefers | last post by:
"Hello World\n", i get error C2143 (Syntaxerror, missing ';' before '<') using the following code: #include <hash_map> struct eqstr { bool operator()(const char* s1, const char* s2) const
2
by: kalpana.sinduria | last post by:
Hi all, how to remove the following complle error. When I compiling the code I get the following errors: Compiling... CDrtEachDefFeat.cpp d:\ include\common\cdrtintegfeat.h(39) : error...
16
by: danu | last post by:
I have a structure : typedef struct{ char magicNum; int width; int height; int maxGrey; int pixels; } ImageT;
2
by: Michael D. Reed | last post by:
Why do I get the following errors: Error 1 error C2143: syntax error : missing ';' before '*' Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int...
6
by: ImageAnalyst | last post by:
Try this: 1) In the code editor, double click some word. 2) Type control-F to bring up the search window. 3) Set the "Look in" drop down box to be "Entire Solution" 4) Click the "Bookmark All"...
2
by: im2cre8iv | last post by:
Here is my code where I am receiving the error: #include <fstream> #include "BinaryTree.h" using namespace std; Node* BinaryTree::MakeTree(ifstream& infile) { char name; infile>>name;
9
by: Kerem Gümrükcü | last post by:
Hi, i am gettin this compiler error over and over for AFIAK perfectly clean code: error C2143: Syntaxerror : Missing ';' before ']' for the Line with the " char szMultibyteString;" ...
2
by: Prashanth Kumar B R | last post by:
Hello, I have the below typedef statements in one of my header file. // // Type Definitions // typedef unsigned long DWORD; typedef unsigned int UINT; typedef unsigned short WORD;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.