The program you posted is still wrong. The answer would be undefined because p = the letter 'E' and p is the letter 'A'. so p+'E'+'A' = p+69+65, or 127 bytes beyond the end of the buffer. Where did I get those numbers? From any ascii chart, like this one.
The code shall print garbage value. Here's why..
p = E ascii code 69, p = A ascii code 65. But p is a itself pointer location.
so p+p+p, will point to the memory location 126 specs beyond the base address of the array c. Hence the printed value will be garbage. if you are sure about the result then please post the entire code.the provided fragment doesn't make sense.
I GOT IT... printf("%s",p+p+p)
here p is a pointer pointing to the string so it will contain the base address of "gate 2011"
p=e [ascii code=69] and
p=a [ascii code=65]
and p+4 means incrementing p by 4,pointer p will now point to 2
and when we print the pointer with specifier %s it prints the string with base address starting at p+4.
hence output is 2011...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...