473,325 Members | 2,442 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,325 software developers and data experts.

Error: missing ' ) ' before identifier 'or'

8
Expand|Select|Wrap|Line Numbers
  1. void Process_Sentence (void) /*Process sentences for counting words and lines*/
  2. {
  3.     Sent_Word = 0;
  4.  
  5.     do
  6.     {
  7.         Non_Word_Character();
  8.         if (Succ_New_Line < 2)
  9.         {    
  10.             Succ_New_Line = 0;
  11.             Word_Character();
  12.                 Sent_Word++;
  13.         }
  14.  
  15.     }while (Next_Char != '.' or '?' or '!') & (Succ_New_Line < 2 );
  16.  
  17. }

Above is a piece of code to add 1 to a count when a full stop, question mark or exclamation mark is used. However when I try and compile it tells me that:

missing ' ) ' before identifier 'or'.

Can anyone help???
Feb 2 '07 #1
7 3442
Ganon11
3,652 Expert 2GB
You should use || instead of or.
Feb 2 '07 #2
RedSon
5,000 Expert 4TB
Do you have any expierence writing c/c++ code? Have you been able to build and compile a hello world app? I think you would benefit alot from reading this.
Feb 2 '07 #3
RedSon
5,000 Expert 4TB
And this, espically the do-while loop section.
Feb 2 '07 #4
dmot
8
You should use || instead of or.
I've done that and it now tells me that:

'&' requires l-value

Can you help with this?
Feb 2 '07 #5
RedSon
5,000 Expert 4TB
I've done that and it now tells me that:

'&' requires l-value

Can you help with this?
Did you read the information on cplusplus website? What you are doing is making extreamly novice errors that tell me that this might be your first time ever writing code in c/c++. It takes a long time to get started and to learn the syntax and I am not patient enough to hold your hand through it. You need to be a self-starter and work through some of the tutorials provided on this site and the cplusplus site.

However, I will give you this one freebie. The condition of a while loop must have distict boolean statements in oder to make sense.

So it is bad if you do this
Expand|Select|Wrap|Line Numbers
  1. while ( aNum != 0 || 1 || 2 || 3)
It needs to be
Expand|Select|Wrap|Line Numbers
  1. while (aNum != 0 || aNum != 1 || aNum !=2 ... and so on)
Each element between the || operators evaluates to either true or false.
Feb 2 '07 #6
dmot
8
Do you have any expierence writing c/c++ code? Have you been able to build and compile a hello world app? I think you would benefit alot from reading this.
I have no experience as I am currently doing a course in it. This is my first assignment and is due in tuesday. Am currently trying to work out the errors when I compile.
Feb 2 '07 #7
RedSon
5,000 Expert 4TB
I can tell this is your first assignment. If you have a textbook you should take an hour and read through the chapters your instructor has asked you to read. If you still do not understand what is going on, then the next step is to contact your instructor and ask them for help. After all that is why they are getting paid, to teach you something. If that doesnt work try working through some tutorials online written by much smarter people then myself. Lastly if you are still haveing problems then post your code again, and describe what you think the problems are and what you think the solution is.
Feb 2 '07 #8

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

Similar topics

3
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
1
by: Minh | last post by:
I've just installed VS.NET 2003 on my Athlon XP 1800+. However I couldn't get any project with STL includes to compile even if I create a new empty project (and added #include <string>). It gave me...
6
by: Yan | last post by:
Here is the code: class A {}; void (A::*A) (); // Line 3 int main() { A a; // Line 6 return 0; }
2
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, ...
2
by: Nick | last post by:
I'm learning C++ and ran into a compile error using Visual C++ 2005 Express on the following example program (located at http://www.cplusplus.com/doc/tutorial/templates.html): // template...
2
by: yalbizu | last post by:
#include <iostream> #include <string> #include <fstream> #include <iomanip> using namespace std; const int NO_OF_STUDENTS=20; struct studentType { string studentFName; string studentLName;
25
by: notahipee | last post by:
I have been trying to cin an number from 0 to 9 with a leading 0. For example 00 or 07. I was using a switch case. switch (int) { case 01: break; case 02: break;..... My problem arises at 08...
15
by: madhu.ab | last post by:
Hi All, I am getting the following errors when i am including header file winuser.h I dont know whats happening. How will an error occur in winuser.h?? Please help. \microsoft visual...
6
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
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...
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...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
1
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.