>is their any body tell me the Difference between int* a; and int *a; ?
From a language standpoint there's no difference. However, placing the asterisk by the variable makes more sense when you have multiple variables in a declaration:
int *p, *q;
The reason this makes more sense is because when the asterisk is paired with the type, it's easy to forget that it only applies to the first variable:
int* p, q; // q should be a pointer, but it's not
And of course, when you fix that error, it just looks funny:
int* p, *q;
If you only have a single variable per declaration, it's not an issue and you can do whatever you think makes more sense. The problems only show up with multiple variables per declaration.
dont matter. same thing its like sayin a*b versus a * b....its the same thing except for where the space is. the compiler wont care for a space in that situation
This is relevant to the OP and the previous post's questions how???
int* a, b;
Is not the same as this:
int *a, *b;
The first one produces an integer pointer called "a" and an integer called "b". It is a confusing and misleading formatting style that makes it look like the '*' extends to "b" when, in actuality, it does not.
The second produces 2 integer pointers called "a" and "b". The '*' operator associates with the variable name, not the datatype. It's area of effect does not extend past the first comma operator (',') to the right.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
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 ...