File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes C / C++ and the fly likes how to create array dynamically in c++ ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "how to create array dynamically in c++ ?" Watch "how to create array dynamically in c++ ?" New topic

how to create array dynamically in c++ ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 688

i am doing a simple stuff

code in main

i just want to create an array dynamically after taking the value from user, how to do that , in simple manner , i am using turboC, because i am doing some computer graphics & my colg told me to use TurboC
can any one help me solve my problem ?

The Only way to learn is!
Visit my blog
Jason Reaves

Joined: Feb 15, 2013
Posts: 3

Std C++ wants the array size to be a constant so it's known at compile time. If you need dynamic memory you can do something like.

Alternatively you can look into vectors which allow you to use it as a dynamic array.
c++ reference <vector>
Consider Paul's rocket mass heater.
subject: how to create array dynamically in c++ ?
Similar Threads
question on array and printing
priority queue based on unsorted list(Java's LinkedList Class)
Printing out the contents of an array
Sorting an array