error: expected constructor, destructor, or type conversion before ‘void’
so I keep getting this error while trying to compile the .cc file of a class. Here is my .cc code and the .hh code:
.hh:
#ifndef BINTREE_IO_PARINT_HH
#define BINTREE_IO_PARINT_HH
#include "BinTree.hh"
#include "ParInt.hh"
#include <iostream>
void read_bintree_parint(BinTree<ParInt>& a);
void write_bintree_parint(const BinTree<ParInt>& a);
#endif
.cc:
#include "BinTreeIOParInt.hh"
void read_bintree_parint(BinTree<ParInt>& a)
ParInt x;
BinTree<ParInt> a1;
BinTree<ParInt> a2;
x.llegir();
if(x.primer() != 0 and x.segon() != 0)
read_bintree_parint(a1);
read_bintree_parint(a2);
a.BinTree(x, a1, a2);
void write_bintree_parint(const BinTree<ParInt>& a)
ParInt x;
if(not a.empty())
BinTree<ParInt> a1 = a.left();
BinTree<ParInt> a2 = a.right();
x = a.value();
write_bintree_parint(a1);
cout<<" ";
x.escriure();
write_bintree_parint(a2);
a.BinTree(x, a1, a2);
The error I'm getting is this one:
> BinTreeIOParInt.cc:4:1: error: expected constructor, destructor, or type conversion before ‘void’
void read_bintree_parint(BinTree<ParInt>& a){
If someone knows what's happening please explain.
Thank you all
c++ class
add a comment |
so I keep getting this error while trying to compile the .cc file of a class. Here is my .cc code and the .hh code:
.hh:
#ifndef BINTREE_IO_PARINT_HH
#define BINTREE_IO_PARINT_HH
#include "BinTree.hh"
#include "ParInt.hh"
#include <iostream>
void read_bintree_parint(BinTree<ParInt>& a);
void write_bintree_parint(const BinTree<ParInt>& a);
#endif
.cc:
#include "BinTreeIOParInt.hh"
void read_bintree_parint(BinTree<ParInt>& a)
ParInt x;
BinTree<ParInt> a1;
BinTree<ParInt> a2;
x.llegir();
if(x.primer() != 0 and x.segon() != 0)
read_bintree_parint(a1);
read_bintree_parint(a2);
a.BinTree(x, a1, a2);
void write_bintree_parint(const BinTree<ParInt>& a)
ParInt x;
if(not a.empty())
BinTree<ParInt> a1 = a.left();
BinTree<ParInt> a2 = a.right();
x = a.value();
write_bintree_parint(a1);
cout<<" ";
x.escriure();
write_bintree_parint(a2);
a.BinTree(x, a1, a2);
The error I'm getting is this one:
> BinTreeIOParInt.cc:4:1: error: expected constructor, destructor, or type conversion before ‘void’
void read_bintree_parint(BinTree<ParInt>& a){
If someone knows what's happening please explain.
Thank you all
c++ class
1
Probably some manner of syntax error in one of the included headers.
– Lundin
Nov 13 '18 at 12:24
What doesa.BinTree(x, a1, a2);
do?
– Eljay
Nov 13 '18 at 12:29
What is in the other two header files.
– ctrl-alt-delor
Nov 13 '18 at 12:36
add a comment |
so I keep getting this error while trying to compile the .cc file of a class. Here is my .cc code and the .hh code:
.hh:
#ifndef BINTREE_IO_PARINT_HH
#define BINTREE_IO_PARINT_HH
#include "BinTree.hh"
#include "ParInt.hh"
#include <iostream>
void read_bintree_parint(BinTree<ParInt>& a);
void write_bintree_parint(const BinTree<ParInt>& a);
#endif
.cc:
#include "BinTreeIOParInt.hh"
void read_bintree_parint(BinTree<ParInt>& a)
ParInt x;
BinTree<ParInt> a1;
BinTree<ParInt> a2;
x.llegir();
if(x.primer() != 0 and x.segon() != 0)
read_bintree_parint(a1);
read_bintree_parint(a2);
a.BinTree(x, a1, a2);
void write_bintree_parint(const BinTree<ParInt>& a)
ParInt x;
if(not a.empty())
BinTree<ParInt> a1 = a.left();
BinTree<ParInt> a2 = a.right();
x = a.value();
write_bintree_parint(a1);
cout<<" ";
x.escriure();
write_bintree_parint(a2);
a.BinTree(x, a1, a2);
The error I'm getting is this one:
> BinTreeIOParInt.cc:4:1: error: expected constructor, destructor, or type conversion before ‘void’
void read_bintree_parint(BinTree<ParInt>& a){
If someone knows what's happening please explain.
Thank you all
c++ class
so I keep getting this error while trying to compile the .cc file of a class. Here is my .cc code and the .hh code:
.hh:
#ifndef BINTREE_IO_PARINT_HH
#define BINTREE_IO_PARINT_HH
#include "BinTree.hh"
#include "ParInt.hh"
#include <iostream>
void read_bintree_parint(BinTree<ParInt>& a);
void write_bintree_parint(const BinTree<ParInt>& a);
#endif
.cc:
#include "BinTreeIOParInt.hh"
void read_bintree_parint(BinTree<ParInt>& a)
ParInt x;
BinTree<ParInt> a1;
BinTree<ParInt> a2;
x.llegir();
if(x.primer() != 0 and x.segon() != 0)
read_bintree_parint(a1);
read_bintree_parint(a2);
a.BinTree(x, a1, a2);
void write_bintree_parint(const BinTree<ParInt>& a)
ParInt x;
if(not a.empty())
BinTree<ParInt> a1 = a.left();
BinTree<ParInt> a2 = a.right();
x = a.value();
write_bintree_parint(a1);
cout<<" ";
x.escriure();
write_bintree_parint(a2);
a.BinTree(x, a1, a2);
The error I'm getting is this one:
> BinTreeIOParInt.cc:4:1: error: expected constructor, destructor, or type conversion before ‘void’
void read_bintree_parint(BinTree<ParInt>& a){
If someone knows what's happening please explain.
Thank you all
c++ class
c++ class
edited Nov 13 '18 at 12:41
ctrl-alt-delor
4,15332443
4,15332443
asked Nov 13 '18 at 12:19
Sergi DoceSergi Doce
11
11
1
Probably some manner of syntax error in one of the included headers.
– Lundin
Nov 13 '18 at 12:24
What doesa.BinTree(x, a1, a2);
do?
– Eljay
Nov 13 '18 at 12:29
What is in the other two header files.
– ctrl-alt-delor
Nov 13 '18 at 12:36
add a comment |
1
Probably some manner of syntax error in one of the included headers.
– Lundin
Nov 13 '18 at 12:24
What doesa.BinTree(x, a1, a2);
do?
– Eljay
Nov 13 '18 at 12:29
What is in the other two header files.
– ctrl-alt-delor
Nov 13 '18 at 12:36
1
1
Probably some manner of syntax error in one of the included headers.
– Lundin
Nov 13 '18 at 12:24
Probably some manner of syntax error in one of the included headers.
– Lundin
Nov 13 '18 at 12:24
What does
a.BinTree(x, a1, a2);
do?– Eljay
Nov 13 '18 at 12:29
What does
a.BinTree(x, a1, a2);
do?– Eljay
Nov 13 '18 at 12:29
What is in the other two header files.
– ctrl-alt-delor
Nov 13 '18 at 12:36
What is in the other two header files.
– ctrl-alt-delor
Nov 13 '18 at 12:36
add a comment |
2 Answers
2
active
oldest
votes
My glass ball says that you forgot to put a semicolon at the end of ParInt.hh. You might want to provide the source for those two headers, because it's pretty hard to debug without them.
add a comment |
When you do #include …
the compiler pasts the content of the file in place of the #inculde
(well almost, there are some subtle things involving line numbers and filenames, but you can ignore them).
As you sometimes get error messages for a line below where the error is. This can also happen with #include
, the error is probably in one of the included files.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280884%2ferror-expected-constructor-destructor-or-type-conversion-before-void%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
My glass ball says that you forgot to put a semicolon at the end of ParInt.hh. You might want to provide the source for those two headers, because it's pretty hard to debug without them.
add a comment |
My glass ball says that you forgot to put a semicolon at the end of ParInt.hh. You might want to provide the source for those two headers, because it's pretty hard to debug without them.
add a comment |
My glass ball says that you forgot to put a semicolon at the end of ParInt.hh. You might want to provide the source for those two headers, because it's pretty hard to debug without them.
My glass ball says that you forgot to put a semicolon at the end of ParInt.hh. You might want to provide the source for those two headers, because it's pretty hard to debug without them.
answered Nov 13 '18 at 12:35
dascandydascandy
5,91111944
5,91111944
add a comment |
add a comment |
When you do #include …
the compiler pasts the content of the file in place of the #inculde
(well almost, there are some subtle things involving line numbers and filenames, but you can ignore them).
As you sometimes get error messages for a line below where the error is. This can also happen with #include
, the error is probably in one of the included files.
add a comment |
When you do #include …
the compiler pasts the content of the file in place of the #inculde
(well almost, there are some subtle things involving line numbers and filenames, but you can ignore them).
As you sometimes get error messages for a line below where the error is. This can also happen with #include
, the error is probably in one of the included files.
add a comment |
When you do #include …
the compiler pasts the content of the file in place of the #inculde
(well almost, there are some subtle things involving line numbers and filenames, but you can ignore them).
As you sometimes get error messages for a line below where the error is. This can also happen with #include
, the error is probably in one of the included files.
When you do #include …
the compiler pasts the content of the file in place of the #inculde
(well almost, there are some subtle things involving line numbers and filenames, but you can ignore them).
As you sometimes get error messages for a line below where the error is. This can also happen with #include
, the error is probably in one of the included files.
answered Nov 13 '18 at 12:40
ctrl-alt-delorctrl-alt-delor
4,15332443
4,15332443
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280884%2ferror-expected-constructor-destructor-or-type-conversion-before-void%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Probably some manner of syntax error in one of the included headers.
– Lundin
Nov 13 '18 at 12:24
What does
a.BinTree(x, a1, a2);
do?– Eljay
Nov 13 '18 at 12:29
What is in the other two header files.
– ctrl-alt-delor
Nov 13 '18 at 12:36