what is the difference between these initializations?
Char a[]=”string”;
Char *p=”literal”;
Does *p++ increment p, or what it points to?
Answer Posted / vignesh1988i
surely there is some difference.....
here 'a' is represented as array in which string gets stored
in consecutive locations......
p is a pointer variable where string is initilized... so in
p the base address of "literal " will get stored......
*p++ increments 'p' , but pertaining to some conditions.....
++ has more precedence than * , so first it will increment
the address and correspondingly it will show the value as *
precedes..... so after the increment the p points to 'i'...
thank u
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
Is it possible to use curly brackets ({}) to enclose single line code in c program?
while initialization of array why we use a[][2] why not a[2][]...?
Can we change the value of #define in c?
What is an example of structure?
Write a program to print "hello world" without using a semicolon?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
How can you pass an array to a function by value?
How can you increase the size of a dynamically allocated array?
What is hungarian notation? Is it worthwhile?
Explain how do you sort filenames in a directory?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Is c weakly typed?
Define C in your own Language.
What is the correct code to have following output in c using nested for loop?