can anyone tell me whether we can use const variables for case ...eg I wrote the following code:
const int i=2;
int j=0;
switch(1)
{
case i:printf("hii");
}
now ...this snippet is running properly in turbo c but not in dev cpp...
likewise if we use this const variable as array index during initialisation...would it work...
can anyone explain ...at what time memory is allocated for variables...