Does this offer declare two pointers or a pointer and an object? Is this true for any type of variable?
int* x, y;
int* x, y; - pointer x and integer variable y .
* refers to a variable , not a type .
Declare a type using typedef (or in C ++ using using ) - then another thing:
typedef int * pint; pint x, y; Here both x and y are pointers to int .
typedef int * pint; in C. - 0andriytype * in void * works), the const qualifier is bad with that. You can read stackoverflow.com/questions/3781932 with comments and answers, then follow the link there. - 0andriyPointer and non pointer.
Therefore, it is customary to write an asterisk in front of the variable name, not in front of the type.
#include <stdio.h> int main() { short *a, b; printf("%zu %zu\n", sizeof a, sizeof b); return 0; } Source: https://ru.stackoverflow.com/questions/625271/
All Articles