constants in c

can we change the constant

Page 1 of 1

5 Replies - 373 Views - Last Post: 18 August 2010 - 04:09 AM Rate Topic: -----

#1 Guest_LakshumaiahGoud*


Reputation:

constants in c

Posted 17 August 2010 - 10:22 AM

in c programming language can we change the constant variable if yes how

ex:- const int a=10;


i want to assign a value to 20

is it possible in c
Is This A Good Question/Topic? -2

Replies To: constants in c

#2 Crunch  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 139
  • View blog
  • Posts: 1,222
  • Joined: 28-July 09

Re: constants in c

Posted 17 August 2010 - 10:25 AM

If you can do that then there is no meaning in using the const keyword.
Was This Post Helpful? 0
  • +
  • -

#3 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1072
  • View blog
  • Posts: 4,532
  • Joined: 09-June 09

Re: constants in c

Posted 17 August 2010 - 10:26 AM

Whats the pointing of creating a constant variable if you just going to change it? Doesnt sound very constant to me
Was This Post Helpful? 0
  • +
  • -

#4 shamerella  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 27
  • Joined: 05-October 09

Re: constants in c

Posted 17 August 2010 - 09:19 PM

you can change it by simply removing the 'const' in front of your constant variable, because that is the only thing stopping you.
Was This Post Helpful? 0
  • +
  • -

#5 BigDinTheMornin  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 56
  • Joined: 21-June 09

Re: constants in c

Posted 17 August 2010 - 09:25 PM

Look up the definition of the word 'Constant' and then reply with the definition. You can use any dictionary at your own will.
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6039
  • View blog
  • Posts: 23,436
  • Joined: 23-August 08

Re: constants in c

Posted 18 August 2010 - 04:09 AM

Oh, you came back as a guest to do the same homework dumps, eh? Don't make me IP ban you.

Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1