What is the difference between char a[] = "string"; and
char *p = "string"; ?
Answer Posted / karuna
a[] is a constant pointer to a string;
char *p is a pointer to a constant string;
In a[] address of a[] cant be change but string can be
change.
In char *p address can be change string cant be change
Is This Answer Correct ? | 15 Yes | 3 No |
Post New Answer View All Answers
What does emoji p mean?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
What is the use of a static variable in c?
Why C language is a procedural language?
Where are the auto variables stored?
find out largest elemant of diagonalmatrix
Compare interpreters and compilers.
What is meant by operator precedence?
What is a char c?
What is the use of gets and puts?
Do pointers take up memory?
What are categories used for in c?
What are the __date__ and __time__ preprocessor commands?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none