Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:37:37+00:00 2026-06-12T19:37:37+00:00

I am only in the beginning steps of this program but I like to

  • 0

I am only in the beginning steps of this program but I like to compile as I am making code. Also I am very new with ADTs so when making this code I ran into some problems that I have no idea what they mean.

Expression.h

#include "header.h" //Library that contains thing like iomanip, cstring, etc.

class Expression
{
        private:
          char *ieEXP; //Array of characters
          char *peEXP; //Array of characters
          const int MAX = 40; //Max size for the array
        public:
          //Initialize both arrays to 0
          Expression(){ieEXP[MAX] = {0}, peEXP[MAX] = {0}};

          Expression(const Expression &);

          //Destroy contents within the array after program completes
          ~Expression(){ieEXP[MAX] = {0}, peEXP[MAX] = {0}};


          //void ReadInFix(char *ieEXP);
          //void PrintInFix(char *ieEXP);
          //void StrCatch();
          //bool IsOperator();
          //void IntoPostFix(char *peEXP);
          //void PrintPostFix(char *peEXP);
          //int Priority();
};

Compilation

g++ -c Expression.h

This is the exact error that I get

Expression.h:1: error: expected constructor, destructor, 
or type conversion before string constant

Also other methods have not been used yet simply just creating the class right now, and int main has not called anything yet.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:37:38+00:00Added an answer on June 12, 2026 at 7:37 pm

    The solution is probably to not compile a header file, as g++ doesn’t recognize *.h as a source file. You probably want to create a .cpp file that includes your header, and compile that. g++ will recognize the .cpp and treat it properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I'd be very sorry to hear this is a stupid question, but I've done
This javascript I have is supposed to be very simple. It is, but IE
strip_tags only catches tags that have a beginning and end tag. With the strings
Only one instance of a ScriptManager can be added to the page. this error
Only editor can post into database but the price could'nt Post into database.. So,
I only get this warning if I import my helper class (#import JLHelper.h). An
I've read a lot, including here on SO that suggests this is a very
I am not sure how to go about doing this, but I have an
This is the beginning -- I have a file on disk which is HTML
How can i restrict my program to run only instance? Currently i'm running my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.