473,387 Members | 1,603 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,387 software developers and data experts.

error: expected primary-expression before ‘)’ token

84
Is there a typical mistake which generates the error:
" error: expected primary-expression before ‘)’ token"

because I fail to see why I get this problem and the code is too big to post it here. Also just saying that it depends on the case would be very helpful so I kinow it something specific about the changes I made...
Jul 25 '07 #1
4 22207
ravenspoint
111 100+
Please post line generating error and a few previous lines.
Jul 25 '07 #2
sanctus
84
Please post line generating error and a few previous lines.
Thanks very much for making me post it, because then I saw that the error was at line 783 and not at line 773... and there I had somefunction(x,)...i.e forgot a comma (is that english?).
But as I have posted it I have another question more about logic.

in the header file cmbcalc.h there is are the definitions:
Expand|Select|Wrap|Line Numbers
  1. bool infla;//true=inflation, false= seed
  2.  int go(Cosmos* cosmos,string name,ControlPanel&,bool interactive=false,bool infla=true);
  3.  
In the file cmbcalc.cc the function go is defined:
Expand|Select|Wrap|Line Numbers
  1. int CmbCalc::go(Cosmos* cosmos,string name,ControlPanel& control, bool interactive, bool infla) {
  2.  
  3. (...about 100 lines...)
  4.  
  5. if (control.cmb) {
  6. (...)
  7.  if (control.scalar && infla) {
  8.       (...)
  9.  // Loop over wavenumbers, calculating perturbations for each k-mode
  10.       for (int k = 1; k <= nk; ++k) oneK(k,cosmos,control,infla);
  11.     }
  12.     infla=false;
  13.  if (control.scalar && ! infla){
  14.       // Loop over wavenumbers, calculating perturbations for each k-mode
  15.       for (int k = 1; k <= nk; ++k) oneK(k,cosmos,control,infla);
  16.  
  17.   }
  18.    if (! control.cmb) nk =0;  
  19.   if (interactive) return nk;
  20.   }
  21.   return 0;
  22. }
  23.  
eventually where I'm not sure is when in another file it calls:
Expand|Select|Wrap|Line Numbers
  1. #include"cmbcalc.h"
  2. void CmbMainWindow::spool() {
  3.   try {
  4.         int nk = cmbcalc->go(cosmos,"dudei",*control,true,true);
  5. (...)
  6.  
(The first true means interactive=true), the question is will the 2 loops (and initializations I didn't write) in go() be calculated or are they cut off because the condition interactive=true is satisfied and hence the function is stopped and returns just nk. I know thiis would be the case if the if(interactive) condition would come before the other three if-conditions. Thanks to anyone taking the time to understand my question!!!
Jul 25 '07 #3
ravenspoint
111 100+
Coding is tough. It is best not to strain you brain unless neccessary. If you are wondering, does this code execute or not do this:

1. Set up a test case.

2. Run the test case in the debugger with a breakpoint on the line you want to know about.
Jul 25 '07 #4
sanctus
84
Coding is tough. It is best not to strain you brain unless neccessary. If you are wondering, does this code execute or not do this:

1. Set up a test case.

2. Run the test case in the debugger with a breakpoint on the line you want to know about.

Good idea I will do that, thanks.
Jul 25 '07 #5

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

Similar topics

2
by: bubzilla | last post by:
Hi, i´ve got about 10 headerfiles with implemented classes. Now when i try to compile them i get the following message: In file included from Proxy/ServerCnx.hh:36, from Proxy/Payload.hh:30,...
21
by: Ram Prasad | last post by:
I am trying to write a simple libspf2 plugin code for my postfix ( milter) I am getting this unhelpful error message when I try to compile gcc -g1 -Wall -I/usr/local/include/spf2 -I. -c mfunc.c...
5
by: gyre | last post by:
Hi! I've got a little problem I've been dealing with for several days :(( Code is written in Qt. I'll try to explain it: I created an abstract class "VcaNode" with 4 virtual methods and 3 other...
5
by: amitmool | last post by:
hi, i have used the queue library file and try to use the template as template <class QueueItem> queue <QueueItem>::~queue() // line 25 { } template <class QueueItem> void...
5
by: nina01 | last post by:
Hi! I'm working on a mini compiler with flex and bison. The ".l" and ".y" files are generated successfully. However, when I try to compile the hole thing using the command "gcc -o comp comp.tab.c...
10
by: anju1401 | last post by:
Hi I am using WINAVR compiler for ATMEGA32. While compiling c progam , I am getting the error error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before '{' token before evrey function. ...
1
by: bals3239 | last post by:
I am using a program called putty to write basic programs in C/ C++ for an introduction to computer programming class. I am very new at programming and am just getting started writing very simple...
12
by: sam23 | last post by:
Hi all, im new to this programming language and i tried to use my Xcode to build and run this code but i got a error :(, and another error is i need a help guys #include <GLUT/glut.h>...
1
by: rameshjumgam | last post by:
i am having in my code like std::list<T*>::const_iterator iter=lst.begin(); and i am getting error error: expected `;' before âiterâ /root/INCLUDE/cw/gdlist.h:140: error: âiterâ was...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.