Here's my header file with the array Data that my teacher wants to initialize in Heap's constructor.
#ifndef HEAP_H
#define HEAP_H
class Heap
{
private:
int Data [100];
int Parent(int);
int RightChild(int);
int LeftChild(int);
void Heapify(int*, int);
void BuildHeap(int*);
public:
Heap();
void insert(int*);
void HeapSort(int*);
void ExtractMaximum(int*);
int Maximum(int*);
void PrintHeap(int*);
int heapsize;
int* GetData();
};
#endif
The Constructor is here:
Heap::Heap()
{
Data = {4, 12, 3, 19, 23, 5, 32, 11, 2, 24};
heapsize = 10;
BuildHeap(Data); //build a heap with initial values
}
Whenever I run the code with the first line of code in the constructor, initializing the array, I get the following warning:
Warning: extended initializer lists only available with
-std=c++0xor-std=gnu++0x
Clearly I'm doing something wrong, and this is the only error/warning I have with this code, and it runs when I take away the line of code initializing Data.
g++ ...,g++ -std=c++0x ....