To const or not to const...

Christian Ehrhardt ehrhardt@mathematik.uni-ulm.de
Thu Feb 20 16:21:00 GMT 2003


On Thu, Feb 20, 2003 at 03:02:11PM +0100, Jan-Benedict Glaw wrote:
> int main() {
> 	int b = "again_hello"[5]; /* #2 */
> 	return 0;
> }
> 
> 
> Assignment #2 is okay from GCC's eyes, but #1 isn't:

This is because in the case of #2 the initializer need not be constant
because the initialization takes place inside a function.

   regards  Christian

-- 
THAT'S ALL FOLKS!



More information about the Gcc mailing list