Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

gcc 10.1.0

Options
Warnings
Don't Use Boost
C++2a
no pedantic

Author

anonymous

over 4 years ago

$ g++ prog.cc -Wall -Wextra -std=c++2a
prog.cc: In constructor 'Queue::Queue(int)':
prog.cc:15:14: warning: unused variable 'arr' [-Wunused-variable]
   15 |         int *arr= new int[c*sizeof(int)];
      |              ^~~
prog.cc: In function 'int dequeue(Queue*)':
prog.cc:46:10: warning: unused variable 'x' [-Wunused-variable]
   46 |      int x = queue->arr[queue->front];
      |          ^
prog.cc: In function 'int main()':
prog.cc:69:28: error: no matching function for call to 'Queue::Queue()'
   69 |     Queue* queue=new Queue();
      |                            ^
prog.cc:10:5: note: candidate: 'Queue::Queue(int)'
   10 |     Queue(int c)
      |     ^~~~~
prog.cc:10:5: note:   candidate expects 1 argument, 0 provided
prog.cc:4:7: note: candidate: 'constexpr Queue::Queue(const Queue&)'
    4 | class Queue
      |       ^~~~~
prog.cc:4:7: note:   candidate expects 1 argument, 0 provided
prog.cc:4:7: note: candidate: 'constexpr Queue::Queue(Queue&&)'
prog.cc:4:7: note:   candidate expects 1 argument, 0 provided
prog.cc: In function 'int dequeue(Queue*)':
prog.cc:50:1: warning: control reaches end of non-void function [-Wreturn-type]
   50 | }
      | ^
Exit Code:
1