What is type struct ?
Type variable // we change the type
type struct ?Code:type integer int x // x store integer value x = 12 type charactr char y // y store charactr value y = 'K' type float float z // z store floating value z = 11.09
What is type struct ?
Type variable // we change the type
type struct ?Code:type integer int x // x store integer value x = 12 type charactr char y // y store charactr value y = 'K' type float float z // z store floating value z = 11.09
Last edited by Player777; 02-09-2020 at 11:36 PM.
A struct type is a type that can be used to group objects of various types together into a single object.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
You can find such examples in any good introductory C textbook.
Nonetheless, here is an example:
Then using the notation you used in post #1:Code:struct X { int a; float b; };
Code:type struct X struct X w // w store integer value w.a = 12 and floating value w.b = 11.09
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
The pointer is named v.Originally Posted by Player777
C programmers often loosely use the word "struct" or "structure" to mean an object of struct type. In your example, there is no such object. struct X refers to the type, not the object.Originally Posted by Player777
What material are you using to learn C?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
If you're having difficulty understanding K&R, then put it aside for now and reach for a beginner's introductory book rather than an experienced programmer's introductory book.Originally Posted by Player777
What does the term "structure object" mean to you?Originally Posted by Player777
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)