How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLPROG Your Own Question
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7260
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
Type Your Programming Question Here...
ATLPROG is online now

Not vector

Customer Question

I'd like to do this but without declaring the size (not vector but self expanding also):

Submitted: 2 years ago.
Category: Programming
Expert:  Ingo U replied 2 years ago.
Can you write a snippet of pseudo-code or something that would show how you might want to use the self-expanding array?
Customer: replied 2 years ago.

Same thing only for strings:

Expert:  Ingo U replied 2 years ago.
I see, well unfortunately that code is faulty. the "new" statement only allocates space for one integer ( array of size 1), so if you enter more than one number, you're writing to memory that isn't "yours".
Customer: replied 2 years ago.

sizeof(int) = 4. sizeof(string) = 4.

Expert:  Ingo U replied 2 years ago.
My apologies,I am out of ideas on this one at the moment.I am opting out and opening the question up to other professionals here who may be able to help.Regards,Ingo U