Click here to Skip to main content
11,789,512 members (54,762 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Expression must have a constant value

, 13 Feb 2013 CPOL 0
The expression must be constant at compile time. Your code uses a run-time constant. A compile time constant would look like this:const int x = 5;Point *Room[x]; // OK hereTo create an array at runtime, use the new operator:Point *Room = new Point[size];// Use Room here// ...//...



Compare Revision Minor Date Status Editor
2 - publicly available No 13-Feb-13 6:53 Available Jochen Arndt
Added notes
1 No 13-Feb-13 6:47 Available Jochen Arndt


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Jochen Arndt
Germany Germany
Jochen started programming in the 80s using Assembler (Z80, 8080, x86), BASIC, C, and TurboPascal. Actually he uses mainly C++ and Perl. He is a graduate engineer in communications engineering (University of Applied Sciences Kiel, 1991).

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1509028.1 | Last Updated 13 Feb 2013
Article Copyright 2013 by Jochen Arndt
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid