aspose file tools
The moose likes C / C++ and the fly likes ArrayList equivalent in C? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Reply Bookmark "ArrayList equivalent in C?" Watch "ArrayList equivalent in C?" New topic
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
    
    6

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: ArrayList equivalent in C?
 
Similar Threads
Constructing an array.
Resetting the array size
processing with arrays
how to increase the size of an array
Need help with sorting an array