About 21,600,000 results
Open links in new tab
  1. 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:

  2. 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 …

  3. 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 …

  4. c - Difference between -> and . in a struct? - Stack Overflow

    If I have a struct like struct account { int account_number; }; Then what's the difference between doing myAccount.account_number; and myAccount->account_number; or isn't there a …

  5. 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 …

  6. What are the differences between struct and class in C++?

    The difference between struct and class keywords in C++ is that, when there is no specific specifier on particular composite data type then by default struct or union is the public …

  7. c - Copying one structure to another - Stack Overflow

    memcpy (dest_struct, source_struct, sizeof (*dest_struct)); The only thing you need to be aware of is that this is a shallow copy. In other words, if you have a char * pointing to a specific string, …

  8. Why should we typedef a struct so often in C? - Stack Overflow

    I have seen many programs consisting of structures like the one below typedef struct { int i; char k; } elem; elem user; Why is it needed so often? Any specific reason or applicable area?

  9. C - function inside struct - Stack Overflow

    The lifetime of the struct object ends when Hello() returns, but this doesn't matter either since a copy of that local struct is returned, not a pointer. When Hello() is called from main a copy of …

  10. Difference between 'struct' and 'typedef struct' in C++?

    In C, the struct tags, union tags and enumeration tags share one namespace, rather than (struct and union) using two as claimed above; the namespace referenced for typedef names is …