C struct

Consider this code:

1
2
3
  struct names {
    int x;
};


Initialize a variable of struct names:
struct names namesVariable

So does it mean that struct names is the same as int, double or float types?

Also is int, double implemented the same way as structs where it looks like this? :
1
2
3
4
int {

.......
};

Last edited on
In C, a struct is a record. It's an ordered set of other types or records.
http://en.wikipedia.org/wiki/Record_%28computer_science%29

In C, there are certain built in types that are fundamental: int, short, long, float double (and possibly long long, long double depending on the version).

A record is a fundamental data structure and it's used all over the place in every procedural system.
as far as i know, no. struct create new data types, but, in case of int, double, etc it's diferent things, it's not [structs

CMIIW
Topic archived. No new replies allowed.