I'm trying to compile c++ on visual studio for the first time, and I'm countering an error.
/***Setup****/
struct id_priority{
int id;
int priority;
};
struct temp_heap{
int id;
int priority;
};
/**heapify up**/
void heapify(id_priority heap[], int index, int length, temp_heap temp){
}
int main(){
int *command_processed;
command_processed = new int[6];
id_priority *heap;
heap = new id_priority[1000];
temp_heap temp;
int index = 0;
int length = 0;
heapify(heap, index, length, temp);
return (0);
}
heapify(heap, index, length, temp); this line it says uninitialized local variable "temp" used, but this code works fine on terminal on Linux. I dont know whats wrong here.