![]() |
|
#1
|
|||
|
|||
Const Pointer with Scope Resolution Operator IssueI am trying to do this
CPP / C++ / C Code:
The above works fine. Although, I can't seem to figure out how to implement Code:
What I have CPP / C++ / C Code:
i tried this and it doesn't work. CPP / C++ / C Code:
Any idea how to define this properly ? Thanks, Bruce |
|
#2
|
|||
|
|||
|
Quote:
The reference from your previous post gives a solution. Here's what your header can look like: CPP / C++ / C Code:
Note: Your header included a cpp file. I strongly recommend that you don't include files with executable code. Compile them separately. Regards, Dave |
|
#3
|
|||
|
|||
|
Quote:
Okay, I have taken the cpp out of the header file. My header is not the same as before. This is what it is now. CPP / C++ / C Code:
I am getting this error.. hmm Code:
|
|
#4
|
||||
|
||||
|
The error you are seeing results from one of the most common mistaskes in programming: the silly typo/mixup. Everyone does this, it's just a matter of how often. The more careful and experienced you are, the fewer errors of this type you will have.
Take a close look at these two chucks of code copied from your post: CPP / C++ / C Code:
CPP / C++ / C Code:
If you still don't see it (which often happens when you've been working on the same problem or looking at the same code for too long), then compare the array sizes in the first two statements with the sizes specified in the second two statements. Don't get too frustrated about this mistake, rather try to always keep it in the front of your mind to look for these kinds of things first. Matthew P.S. See the first line of this post for a coincidental example of a typo! |
|
#5
|
|||
|
|||
LOL. Gzz always learning!Okay, now I am a little happier. I was scratching my head over that one. How do you recommend compiling this program now, seeing how I took the
CPP / C++ / C Code:
Code:
Code:
Here is my main.cpp file CPP / C++ / C Code:
I get this error Code:
|
|
#6
|
|||
|
|||
|
Quote:
Try this (ya gotta tell the compiler about all of the files) Quote:
Regards, Dave |
|
#7
|
|||
|
|||
|
Okay I tried that and got an error but I solved it. Maybe you can explain why this has to be?
this is what I did in the console Code:
this is what I moved from CardDeck.h at the bottom of the class to the top of CardDeck.cpp CPP / C++ / C Code:
Thanks man for your help. I learned something and I owe congrats to you. Bruce |
|
#8
|
|||
|
|||
|
Quote:
I don't necessarily agree that more experienced programmers make fewer typos. Speaking from personal experience, as I got more experienced I typed faster and, percentage-wise I made almost as many typographical errors as before. The important point is that experienced programmers look a the error messages and the lines to which the error messages refer (sometimes the lines just before those in the messages). If the compiler says that there is a discrepency between line 26 and line 36: Look at line 26! Look at line 36! #1 debugging tool: your little gray cells (sometimes stimulated by impulses from your optical nerves). Regards, Dave |
Recent GIDBlog
Toyota - 2008 September Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error - unresolved external symbol _WinMain | ap6118 | C++ Forum | 6 | 23-Mar-2005 22:46 |
| I need help implementing | kjc_13 | C++ Forum | 0 | 14-Feb-2005 16:00 |
| template comiling problems - need expert debugger! | crq | C++ Forum | 1 | 01-Feb-2005 21:26 |
| Error: (function) undeclared -first use of this function | crystalattice | C++ Forum | 6 | 01-Nov-2004 04:36 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The