-1
내 코드는 대략 다음과 같습니다다른 클래스의 priority_queue에 어떻게 액세스합니까?
#include <queue>
#include <iostream>
using namespace std;
int main() {
priority_queue <String> pq;
otherClass.qPusher();
pq.pop();
}
어떻게 qPusher 방법 액세스 priority_queue의 PQ합니까? pq에 대한 참조를 qPusher에 전달하려고 시도했지만 구문을 올바르게 알 수없는 것 같습니다. 누구든지이 작업을 수행하는 방법을 알고 있습니까?
'otherClass' 란 무엇입니까? 'otherClass.qPusher'는 무엇을합니까? – 0x499602D2
함수 선언에'qPusher (priority_queue & pq);')를, 호출에'otherClass.qPusher (pq);를 의미합니까? –
user0042