const char *
char * const
What is the differnce between the above tow?.
Answers were Sorted based on User's Feedback
Answer / bava
in the first case it is pointer to a constant (i.e the
address can be changed ,where as the content/value in that
address cannot be changed).
In the later case it is a constant pointer (i.e the address
cannot be changed ,where as the content/value in that
address can be changed).
Is This Answer Correct ? | 10 Yes | 1 No |
Answer / kamaljit singh
in the first case it is pointer to a constant (i.e the
address can be changed ,where as the content/value in that
address cannot be changed).
In the later case it is a constant pointer (i.e the address
cannot be changed ,where as the content/value in that
address can be changed).
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / vignesh1988i
as for as i know.....
1) const char * :
here the character pointer is a constant which can point to
oly one character type memory location throught the program.
2) char * const :
hrere the pointer is not a constant , the character variable
used after it will be constant.. in that variable we cant
make any changes... but in pointer we can make
thank you
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / lokesh143
In first case address is constant
later case value is constant
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / subbu
answer is opposite to above answer
first case is constant pointer means that the address which
is assigned at the time of decalaration can not be changed
yet.
in the second case it is pointer to a constant, means the
value stored at that particular address cannot be changed
Is This Answer Correct ? | 1 Yes | 2 No |
how to find sum of digits in C?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
what is the difference between <stdio.h> and "stdio.h"
14 Answers Invendis, Kanbay, Mastek, MathWorks,
can anyone proide me reading material on svit00ef27@yahoo.com please thanx in advance
Reverse a string word by word??
HOW DO YOU HANDLE EXCEPTIONS IN C?
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
What is #define size in c?
Question 1: You want to conduct a survey within your classroom, on the quality of canteen’s food. You ask each of your class fellows to rank the quality of food between 1 and 5 (1 representing excellent quality and 5 representing worst quality). During the survey, you make a list containing the roll# of student and the opinion given by that student. The list can be as follow Roll # Opinion 234 1 235 1 236 5 237 1 238 2 239 3 240 5 241 5 242 1 To get the results of the survey, you need to determine the frequency of each opinion value. The frequency of an opinion is determined by counting the number of students giving that opinion. For example, for the above list the frequency of opinion value 1 is 4 and frequency of opinion value 4 is 0. After getting the frequency of each opinion, you can easily judge about the quality of the food by seeing through the frequency of each opinion. You need to develop a program to calculate the results of this survey. The program inputs the opinion of 50 students and counts the frequency of each opinion. It then displays a report showing the frequency of each opinion. Sample output: Opinion Frequency Remarks 1 5 Excellent 2 10 Good 3 15 Normal 4 10 Bad 5 10 Really bad
how would a 4*3 array A[4][3] stored in Row Major Order?
suppose there are five integers write a program to find larger among them without using if- else
Where register variables are stored in c?