Question
How do I get rid of this error? The link to the program is https://www.chegg.com/homework-help/questions-and-answers/need-help-programming-assignment-c--development-plan-1-create-directory-assignment-6-creat-q27908947 Compiling.... my-test.cpp: In function 'void doinsert(PriorityQueue&, CSTRING, double, int)': my-test.cpp:13:17:
How do I get rid of this error? The link to the program is https://www.chegg.com/homework-help/questions-and-answers/need-help-programming-assignment-c--development-plan-1-create-directory-assignment-6-creat-q27908947 Compiling.... my-test.cpp: In function 'void doinsert(PriorityQueue&, CSTRING, double, int)': my-test.cpp:13:17: error: invalid initialization of reference of type 'const char* const&' from expression of type 'PriorityQueue' insert(q, x, p); ^ In file included from my-test.cpp:2:0: pqueue.h:32:6: error: in passing argument 1 of 'void insert(const char* const&, PQPriorityType, PriorityQueue&)' void insert(const PQItemType& x, PQPriorityType p, PriorityQueue& q); ^ my-test.cpp: In function 'void test(PriorityQueue&, PriorityQueue&)': my-test.cpp:67:35: error: invalid conversion from 'void (*)(CSTRING) {aka void (*)(const char*)}' to 'void (*)(const char* const&)' [-fpermissive] printPriorityQueue(s, mypi, mypp); ^ In file included from my-test.cpp:2:0: pqueue.h:45:6: error: initializing argument 2 of 'void printPriorityQueue(const PriorityQueue&, void (*)(const char* const&), void (*)(PQPriorityType))' [-fpermissive] void printPriorityQueue(const PriorityQueue& q, ItemPrinter pi, PriorityPrinter pp); ^ my-test.cpp:69:35: error: invalid conversion from 'void (*)(CSTRING) {aka void (*)(const char*)}' to 'void (*)(const char* const&)' [-fpermissive] printPriorityQueue(t, mypi, mypp); ^ In file included from my-test.cpp:2:0: pqueue.h:45:6: error: initializing argument 2 of 'void printPriorityQueue(const PriorityQueue&, void (*)(const char* const&), void (*)(PQPriorityType))' [-fpermissive] void printPriorityQueue(const PriorityQueue& q, ItemPrinter pi, PriorityPrinter pp); ^ *****Compilation unsuccessful.*****
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started