About 14,000,000 results
Open links in new tab
  1. c - Difference between -> and . in a struct? - Stack Overflow

    Difference between -> and . in a struct? Asked 14 years, 5 months ago Modified 1 year, 5 months ago Viewed 72k times

  2. c - typedef struct vs struct definitions - Stack Overflow

    225 struct and typedef are two very different things. The struct keyword is used to define, or to refer to, a structure type. For example, this:

  3. What's the syntactically proper way to declare a C struct?

    Sep 12, 2015 · The first declaration is of an un- typedef ed struct and needs the struct keyword to use. The second is of a typedef ed anonymous struct, and so we use the typedef name.

  4. When should you use a class vs a struct in C++? [duplicate]

    The differences between a class and a struct in C++ are: struct members and base classes/structs are public by default. class members and base classes/structs are private by …

  5. Return a `struct` from a function in C - Stack Overflow

    But a struct is a properly first-class type, and can be assigned, passed, and returned with impunity. You don't have to define your own operator= (as indeed you could in C++), because …

  6. c# - When to use record vs class vs struct - Stack Overflow

    Nov 13, 2020 · You create struct types for data structures that store data and are small enough to copy efficiently. You create record types when you want value-based equality and comparison, …

  7. Proper way to initialize C++ structs - Stack Overflow

    Jan 21, 2017 · Our code involves a POD (Plain Old Datastructure) struct (it is a basic c++ struct that has other structs and POD variables in it that needs to get initialized in the beginning.) …

  8. c - How to create a new instance of a struct - Stack Overflow

    Note that for p1 the order of properties matches that of the struct definition. If you don't want to type struct all the time when you use a type you can define a new alias using

  9. struct - C++ Structure Initialization - Stack Overflow

    struct address { int street_no; char *street_name; char *city; char *prov; char *postal_code; }; address temp_address = { .city = "Hamilton", .prov = "Ontario" }; The links here and here …

  10. How to properly use `typedef` for structs in C? - Stack Overflow

    Feb 25, 2022 · Note that structure tags are in a separate namespace from typedef names, so it is legitimate to use typedef struct tagname tagname;. The body of the structure can appear …