answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: What are the advantages of using the const keyword rather than?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the purpose if declaring object with keyword const in c plus plus?

The const keyword transforms a variable into a constant. This means the constant cannot be altered via that constant's identifier. The const keyword can also be applied to a class instance method, such that the method will not alter a class instance's immutable members. Note that the const keyword is merely a programming aid that provides assurances a constant will not be altered inadvertently. However, it is still possible to alter the constant by using a non-constant pointer to the constant. However you have to make a conscious effort to override constant behaviour.


How do you declare a constant Explain it with a suitable example?

Declaring a Constant: We can declare a constant using the keyword "const". E.g. const abc='a';const number=10; const number[10]={1,2,3,4,5,6,7,8,9,10}; const name[7]={'K','U','N','D','A','N'}; #include<stdio.h> #include<conio.h> void main() { int i; const name[7]={'K','U','N','D','A','N'}; for(i=0;i<7;i++) { printf("%c",name[i]); getch(); }


Why is an enumeration?

An alternative method for naming integer constants is often more convenient than 'const' . This can be achieved by using keyword enum. for example : enum { START , PAUSE , GOO };


What words should I avoid using in a keyword search?

When you do a keyword search avoid using the word or letter I and also generic words, like to, the, on etc. You also need to try not using commas or punctuations in your keyword search.


What are the advantages of using a telephone rather than using sound through the air?

hey paiges lol hailee -xx-


What might be the advantages of using scent rather than sight to attract a mate?

There are many possible advantages of using scent to attract a mate. One advantage is that you know they're compatible.


Two advantages of using CD-ROM encyclopedia rather than the Internet to get this information?

Africa


What advantages are there in using such a flight simulator rather than using a real aircraft?

It is less expensive and safer ,particularly for early trainig


Two advantages of using CD-ROM encyclopedia rather than the Internet tp get this information?

advantage and disadvantage of using cd-rom to get information about encyclopedia rather than internet


How can we replace the value of const variable using scanf statement?

You cannot change the value of a const variable. That's what const means - it is constant. If you are considering "trickery" using pointers and the scanf function, understand that this is not supported, is highly non portable, and may fail, depending on whether or not the implementation places its const data in read only memory. Besides, most modern compilers will not allow you to place a const variable as a non-const argument to a function. Use the language within its defined boundaries.


How do you throw exception in java?

we do it using the throw keyword.


What are the advantages of using internet rather than CD ROM?

duffer idiot if i knew the answer i would not ask the question..................