# Thread: What is type struct

1. ## What is type struct

What is type struct ?

Type variable // we change the type

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```
type struct ? 2. A struct type is a type that can be used to group objects of various types together into a single object. 3. Originally Posted by laserlight A struct type is a type that can be used to group objects of various types together into a single object.
I did not understand the meaning of your definition. It would be better to prove your definition by example 4. You can find such examples in any good introductory C textbook.

Nonetheless, here is an example:
Code:
```struct X
{
int a;
float b;
};```
Then using the notation you used in post #1:
Code:
`type struct X       struct X w    // w store integer value w.a = 12 and floating value w.b = 11.09` 5. Originally Posted by laserlight You can find such examples in any good introductory C textbook.
point type integer int *a
point type charactr char *b
pointer type float float *c

What is pointer type struct

struct X * v;

Does the pointer point to the structure object v

Does the pointer point to the structure name X 6. Originally Posted by Player777
Does the pointer point to the structure object v
The pointer is named v. Originally Posted by Player777
Does the pointer point to the structure name X
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.

What material are you using to learn C? 7. Originally Posted by laserlight The pointer is named v.

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.

What material are you using to learn C?
k&r c programming

Code:
```struct X{
int a;
int b;
}

int main ()
{
struct X * v;

v->a ; v is pointer and a is structure object
v->b ; v is pointer and b is structure object

return 0;
}```
What does struct type store ? 8. Originally Posted by Player777
k&r c programming
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
Code:
```v->a ; v is pointer and a is structure object
v->b ; v is pointer and b is structure object```
What does the term "structure object" mean to you? 9. Originally Posted by laserlight What does the term "structure object" mean to you?
Structure is a group of different data types and each element in a C structure is called member

type int store integer value x = 12
type char store charactr value y = 'K'
type float store floating value z = 11.09

What does type struct store ? 10. Originally Posted by Player777 Structure is a group of different data types and each element in a C structure is called member

type int store integer value x = 12
type char store charactr value y = 'K'
type float store floating value z = 11.09

What does type struct store ?
It stores an aggregate of types Popular pages Recent additions charactr, float, store, struct, type 