ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
How to access or modify the const variable in c ?
 Question Submitted By :: Leossk
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to access or modify the const variable in c ?
Answer
# 1
we can access the constant variable in c through the 
functions which are declared as constant.
 
Is This Answer Correct ?    2 Yes 4 No
Santhi
 
  Re: How to access or modify the const variable in c ?
Answer
# 2
const. variable cannot be modified........ if you declare an
variable as:
const char i=90;
throught the program 'i' cant be modified
but #define macro can replace const.. and that macro can be
modified.... but its disadvantage is it will blindly
substitute the data which is #defined.......
 
Is This Answer Correct ?    4 Yes 1 No
Vignesh1988i
 
 
 
  Re: How to access or modify the const variable in c ?
Answer
# 3
use pointers and u can do anything...
 
Is This Answer Correct ?    3 Yes 2 No
Guest
 
  Re: How to access or modify the const variable in c ?
Answer
# 4
const int x = 10;
int *ptr = &x;
*ptr = 20;
printf ("Value of x is %d\n", x);

Even though the variable x is const the value gets changed..
And its one of the drawback in c..
 
Is This Answer Correct ?    2 Yes 2 No
Ramya
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
HOW TO SWAP TWO NOS IN ONE STEP? Satyam12
what is the difference between declaration and definition of a variable or function ?  2
fun(int x) { if(x > 0) fun(x/2); printf("%d", x); } above function is called as: fun(10); what will it print? } NDS13
what will be the output: main(){char ch;int a=10;printf("%d",ch);} Wipro29
if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE  1
write a program to find the number of even integers and odd integers in a given array in c language Olive-Tech2
for(i=0;i=printf("Hello");i++); printf("Hello"); how many times how will be printed?????????  4
consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none TCS4
Write code for initializing one dimentional and two dimentional array in a C Program? Deshaw5
please give me answer with details #include<stdio.h> main() { int i=1; i=(++i)*(++i)*(++i); printf("%d",i); getch(); }  3
#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); } ADITI2
int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15 Wipro8
#include <stdio.h> #define sqr(x) (x*x) int main() { int x=2; printf("value of x=%d",sqr(x+1)); } What is the value of x? Oracle13
4.A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above Accenture4
can we print any string without using terminator? Infosys2
how to sort two array of characters and make a new array of characters. Accenture1
How can I find out how much memory is available? Persistent1
what is differnence b/w macro & functions  1
Which of the Following is not defined in string.h? A)strspn() B)strerror() C)memchr() D)strod() Accenture1
Who had beaten up hooligan "CHAKULI" in his early college days?  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com