| Author |
ArrayList equivalent in C?
|
Jack Drowder
Greenhorn
Joined: Oct 01, 2012
Posts: 2
|
|
Hi guys,
I'm making a simple calculator program in C. It's supposed to be able to save loads of (floating point) numbers in an array and the array is supposed to expand to accommodate the new numbers. As I've been doing Java for quite some time now, I know that an ArrayList would be useful in this situation, but is there something similar to it in C?
Thanks!
|
 |
K. Tsang
Ranch Hand
Joined: Sep 13, 2007
Posts: 1219
|
|
Not that I know of. You most likely need to define your own data structure as an array list. The link here should give you some insight.
And welcome to the Ranch.
|
K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 9944
|
|
|
C or C++? if the latter, the vector class in the STL may help. If you are talking straight C...you may have to roll your own, as the previous poster said.
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: ArrayList equivalent in C?
|
|
|