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 7742821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:22:28+00:00 2026-06-01T09:22:28+00:00

i don’t know how or why and google wasn’t really helpful neighter,,, but can

  • 0

i don’t know how or why and google wasn’t really helpful neighter,,, but can anyone tell why dose this error pops and how may it get fixed? I tried everything i could think of…. i`m out of ideas.

the error part:

**** Build of configuration Debug for project Lab3-5Mod ****

**** Internal Builder is used for build               
**** g++ -ID:\c++\Begin\Lab3-5Mod -O0 -g3 -Wall -c -fmessage-length=0 -o src\UI.o..\src\UI.cpp
 ..\src\UI.cpp: In function 'int printMenu()':
 ..\src\UI.cpp:39:15: error: expected primary-expression before 'int'
 ..\src\UI.cpp:39:24: error: expected primary-expression before 'int'
 ..\src\UI.cpp:39:39: error: expected primary-expression before 'M'
 ..\src\UI.cpp: In function 'int main()':
 ..\src\UI.cpp:75:18: error: expected primary-expression before 'M'
 Build error occurred, build is stopped
 Time consumed: 370  ms. 

Code:

#include <iostream>
#include "Structs.h"
#include "structs.cpp"
#include "controller.cpp"
#include "UI.h"

using namespace std;

int printMenu(){

int input;
input = 1;
    while (input){
        cout<<"1.  Add to current day "<<endl;
        cout<<"2.  Insert amount to day by type "<<endl;
        cout<<"3.  Remove day "<<endl;
        cout<<"4.  Remove days "<<endl;
        cout<<"5.  Remove type of expenses"<<endl;
        cout<<"6.  Replace type  at specified day"<<endl;
        cout<<"7.  Show expenses bigger than"<<endl;
        cout<<"8.  Show expenses bigger than... to day..."<<endl;
        cout<<"9.  Show expenses of specified type overall"<<endl;
        cout<<"10. Calculate sum of specified type over all"<<endl;
        cout<<"11. Show day with highest expenses"<<endl;
        cout<<"12. Show all days with specified expenses"<<endl;
        cout<<"13. Sort days by expenses increasing"<<endl;
        cout<<"14. Sort days by expenses discreasing"<<endl;
        cout<<"15. Filter type"<<endl;
        cout<<"16. Filter type starting with"<<endl;
        cout<<"---------------------------------------------"<<endl;
        cout<<"18. Undo"<<endl;
        cout<<"0.  Clear and exit!"<<endl;

        cout<<"enter option: ";
        cin>>input;

        switch(input){
        case 1:add(int cant,int tip, Array M);
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9:
        case 10:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
        case 16:
        case 17:
        case 18:
        case 19:
        case 0:break;
        default: cout<<"Wrong input!"<<endl;break;

        }
    }

return 0;
}


int main()
{
//Main function of the program. no pre/ post condition.
Array M;
constr(M);
Array B;
constr(B);
dummyData(Array M);

printMenu();
return 0;
}

Array header:

struct Array{
    int days;
    int exp;
    int **M;
};

void constr(Array &);
void destruc(Array &);
void add(int, int, Array &);

Controller add function:

void add(int cant,int tip, Array M){
//Adds to current day the amount to a specific type
    currDay();
    M.M[currentDay][tip] += cant;
}
  • 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-01T09:22:29+00:00Added an answer on June 1, 2026 at 9:22 am

    You do not call functions like that:

    add(int cant,int tip, Array M);
    

    You need not specify the data types:

    add(cant,tip, M);
    

    Also here: dummyData(Array M); -> dummyData(M);

    You specify the data types only in the declaration, but not when calling the functions.

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

Sidebar

Related Questions

I don't know whether this is really possible, but I'm trying my best. If
Don't know if anyone can help me with this or if it's even possible.
Don't know why but I can't find a solution to this. I have 3
Don't really know how to formulate the title, but it should be pretty obvious
Don't know how to google for such, but is there a way to query
(Don't know if this is strictly on-topic, but I don't see any better Stack
I don't know if this question is trivial or not. But after a couple
Don't know if this is the right place to ask this, but I will
I don't know if this has been asked before, but what i'd like to
Don't ask me why but i can't use this method because I need to

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.