![]() |
|
#1
|
|||
|
|||
Need help with "primary-expression" errorHi everyone. I pretty new to C/C++. Heres my code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
Heres the Error: CPP / C++ / C Code:
Any help would be greatly appreciated |
|
#2
|
|||
|
|||
Re: Need help with "primary-expression" errorTry
CPP / C++ / C Code:
CPP / C++ / C Code:
I don't know if it helps, but looks like it could. Other than that... There are just so many things "weird" or "wrong" or "missing" in your code, I wouldn't know where to begin listing. |
|
#3
|
|||
|
|||
Re: Need help with "primary-expression" errorSimulation(const Environment *);
Use reference instead of pointer or pass by value. I hope this help. __________________
Linux is the best OS in the world. |
|
#4
|
|||
|
|||
Re: Need help with "primary-expression" errorI'll try to point out some things to consider in the future, when posting question and in general.
CPP / C++ / C Code:
So considering your post here, this piece of code is just useless overhead for us. CPP / C++ / C Code:
CPP / C++ / C Code:
If label is just a "string", you might want to take a look at the C++ string class. Also, did you take into account the use of dynamic memory allocation in your destructor, copy constructor and assignment operator? That's another reason why using std::string would be handier. You don't actually need the return statement at the end. CPP / C++ / C Code:
CPP / C++ / C Code:
In any way, your class Simulation doesn't need to know about the implementation of class Environment. It just needs the declaration. CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
cpp] #include "Simulation.h" CPP / C++ / C Code:
|
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linked Lists advice request | promsan | C Programming Language | 74 | 23-May-2007 08:29 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 11:25 |
| Winsock error when compiling FLTK 2.0 Projects | mauriciorossi | FLTK Forum | 3 | 16-Aug-2005 10:18 |
| Help with syntax errors | PeteGallo | C Programming Language | 7 | 08-Aug-2005 20:30 |
| What is "Ambigious symbol" ??*( a compilation error) | small_ticket | CPP / C++ Forum | 2 | 07-Jan-2005 21:10 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The