|
-
Aug 13th, 2002, 12:24 PM
#1
Thread Starter
Ya ya Baby!!!Me is Back
initializing an array
I have an array that I know the size because of a calcul. Something like : iSize = x-y; char c1[iSize];
But I have that error :expected constant expression
-
Aug 28th, 2002, 08:18 PM
#2
Thread Starter
Ya ya Baby!!!Me is Back
I can't initialize an array with code like that ?
-
Aug 29th, 2002, 10:04 AM
#3
Frenzied Member
You can't do that in C/C++
I personally like link lists for problems like this.
But if you want to continue to use arrays you have to use pointers and use new to create a new array to your size and delete to destroy it when you are done with it.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|