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
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
44910485
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): http://pastebin.com/Sm9pRuF6

Submitted: 1 year ago.
Category: Programming
Expert:  Ingo U replied 1 year 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 1 year ago.

Same thing only for strings: http://pastebin.com/fP47nuP7

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

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

Expert:  Ingo U replied 1 year 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

Related Programming Questions