Hello.
I have a question about the structure.
As I study, there are cases where pointer variables are declared and used in the structure, such as "char *name",
What are the benefits of using it like this?
For example, I think you can declare it as "char name" and use it...
struct st {
int id;
char *name;
};
Char is just a data declaration that contains one character.
Perhaps the meaning of the *name of that structure means to contain a string. Because of that, it can't be included in the "char name", right?
Description of characters and strings is
https://dojang.io/mod/page/view.php?id=328
Replace with the link above.
© 2024 OneMinuteCode. All rights reserved.