How to access or modify the const variable in c ?
Answer Posted / varunreddy
try this it will work:
#include<stdio.h>
int main()
{
const int i=10;
*(int *)&i=i++;
printf("%d\n",i);
return 0;
}
Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What are the 4 types of organizational structures?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
Explain the difference between #include "..." And #include <...> In c?
What is the description for syntax errors?
What are the similarities between c and c++?
What is wrong with this program statement?
Write a program to print ASCII code for a given digit.
What is the total generic pointer type?
Explain the difference between null pointer and void pointer.
What is define directive?
Explain low-order bytes.
What is cohesion in c?