This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
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: 692

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>
I agree. Here's the link:
subject: how to create array dynamically in c++ ?
It's not a secret anymore!