This is a well known C Gotcha,to change a const variable will always lead to error.
I guess the main query is "Is this declaration valid" and your compiler only shows error at printf line and not in the declaration.It also states that 'x' is a read-only variable. Hence,it accepts this declaration for read-only variable 'x' which in this case cannot be changed. Regards, Ashish On Sat, Jun 26, 2010 at 11:09 AM, sharad kumar <aryansmit3...@gmail.com>wrote: > pls c thz > > > On Sat, Jun 26, 2010 at 10:48 AM, sharad kumar <aryansmit3...@gmail.com>wrote: > >> cos if u declare const u cant change na.but volatile changes na.....so >> practically u cant declare....U cant do mtech at IIT and MBA at IIM at same >> time rite??? >> >> >> On Sat, Jun 26, 2010 at 10:43 AM, sharad kumar >> <aryansmit3...@gmail.com>wrote: >> >>> no its not cos u have declared const and volatile hw is it possible.... >>> can u go to IIT and IIM at same time???? >>> >>> On Sat, Jun 26, 2010 at 9:22 AM, sharad kumar < >>> sharad20073...@gmail.com> wrote: >>> >>>> static const volatile int x; >>>> Is the declaration valid >>>> plzzz explain >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Algorithm Geeks" group. >>>> To post to this group, send email to algoge...@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/algogeeks?hl=en. >>>> >>> >>> >>> >>> -- >>> yezhu malai vaasa venkataramana Govinda Govinda >>> >> >> >> >> -- >> yezhu malai vaasa venkataramana Govinda Govinda >> > > > > -- > yezhu malai vaasa venkataramana Govinda Govinda > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.