Thread View: net.lang.c++
2 messages
2 total messages
Started by Bennet Yee
Thu, 24 Jul 1986 05:57
constructor declaration
Author: Bennet Yee
Date: Thu, 24 Jul 1986 05:57
Date: Thu, 24 Jul 1986 05:57
15 lines
868 bytes
868 bytes
I've started playing with C++ & wrote the following:
class hashtable {
queue_t bucket[HASHSIZE];
int (*hash_f)(char *);
public:
hashtable(int (*hf)(char *)) { hash_f = hf; }
...
}
but the compiler complains with syntax error at the declaration
for the constructor (3 lines), and also then complains something
about hf, type expected. What did I do wrong, O c++ wizards?
-Bsy
Re: constructor declaration
Author: m.terribile
Date: Wed, 30 Jul 1986 16:19
Date: Wed, 30 Jul 1986 16:19
27 lines
1420 bytes
1420 bytes
> I've started playing with C++ & wrote the following:
>
> class hashtable {
> queue_t bucket[HASHSIZE];
> int (*hash_f)(char *);
> public:
> hashtable(int (*hf)(char *)) { hash_f = hf; }
> ...
> }
>
> but the compiler complains with syntax error at the declaration
> for the constructor (3 lines), and also then complains something
> about hf, type expected. What did I do wrong, O c++ wizards?
>
> -Bsy
Well, for one thing, inline function definitions must be followed by
a semicolon. This is one that your fingers will take a while to get
used to!
--
from Mole End Mark Terribile
(scrape .. dig ) mtx5b!mat
(Please mail to mtx5b!mat, NOT mtx5a!
mat, or to mtx5a!mtx5b!mat)
(mtx5b!mole-end!mat will also reach me)
,.. .,, ,,, ..,***_*.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads