Click here to Skip to main content
12,951,971 members (60,427 online)
Click here to Skip to main content

Tagged as


Posted 13 Feb 2013

Expression must have a constant value

, 13 Feb 2013 CPOL
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 0:53 Available Jochen Arndt
Added notes
1 No 13-Feb-13 0: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...

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