jeudi 3 juillet 2014

how to dynamically allocate 2d array by one row at a time where column is known in c/c++


Vote count:

0




I want to allocate a 2d array(in C or C++) where row is unknown but column is known.I do not want to allocate my row n size first because when i want an input ,the array's first row will allocate with known column size->then i take my input-> put it in my array's row 1 .Then again if i want an input, the array's second row will allocate with known column size->then i take my input-> put it in my array's row 2. this process will run for an unknown number of rows and i want to preserve all my input for further processing.When i press Enter button twice the input will stop and the next process will begin which is not a concern here.What should i do about this or is this possible at all in C or C++ ?Giving me full functional code will be very helpful because i have a very little knowledge about pointer or array or other things that is related to this problem's solution.



asked 18 secs ago






Aucun commentaire:

Enregistrer un commentaire