• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ArrayList equivalent in C?

 
Jack Drowder
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 3508
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12186
34
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic