Click here to Skip to main content
15,897,718 members

Comments by iwanttoaskquestions (Top 20 by date)

iwanttoaskquestions 3-Nov-21 7:49am View    
oh ok thank you for the tip.
iwanttoaskquestions 3-Nov-21 5:47am View    
i have remade the push_back() function, can you tell me if things are wrong:

void push_back(T& is) {
if (size >= capacity) {
capacity = capacity + 10;
scores<t> newscore;
for (int i = 0; i < size; ++i) {
newscore[i] = myscores[i];
}
myscores = new T[capacity];
for (int i = 0; i < size; ++i)
myscores[i] = newscore[i];
}
myscores[size] = is;
++size;
}
iwanttoaskquestions 3-Nov-21 5:07am View    
How do I allocate more memory on this array? Could you please explain it to me?
iwanttoaskquestions 3-Nov-21 0:24am View    
Deleted
oh thanks for the solution. But I also don't know how to check if the size if equal to the capacity and I don't know how to allocate more memory. Could you explain it me?
iwanttoaskquestions 25-Oct-21 4:34am View    
oh ok thank you