File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

how to create array dynamically in c++ ?

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 682

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 ?
thanks


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Jason Reaves
Greenhorn

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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to create array dynamically in c++ ?
 
Similar Threads
Collection
Sorting an array
priority queue based on unsorted list(Java's LinkedList Class)
question on array and printing
Printing out the contents of an array