About 10,900,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. 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 …

  3. 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: struct foo { int n; }; creates a new type called struct …

  4. c - Structure padding and packing - Stack Overflow

    For struct, other than the alignment need for each individual member, the size of whole struct itself will be aligned to a size divisible by strictest alignment requirement of any of its members, by …

  5. Naming convention when using STRUCT in C - Stack Overflow

    The name of a struct is considered a tag, whereas a typedef creates a type name. These live in two different namespaces and will not collide. In my opinion, it makes a lot more sense for the …

  6. c - Members of Dirent structure - Stack Overflow

    Oct 20, 2012 · 32 I have started working with dirent.h library and I came across a very useful member of "struct dirent" structer which struct dirent *p->d_name in my book. But unfortunatly …

  7. How are struct members allocated in memory? - Stack Overflow

    While attempting to create a memory manager for future C programs, I've come across this question: "when structs are allocated, are their member fields stored in the order …

  8. c - Difference between a Structure and a Union - Stack Overflow

    Is there any good example to give the difference between a struct and a union? Basically I know that struct uses all the memory of its member and union uses the largest members memory …

  9. How to work with string fields in a C struct? - Stack Overflow

    Apr 15, 2012 · This approach often leads to confusion about the nature, lifetime, and ownership of the string pointers in the struct. The accepted answer exemplifies a common approach to …

  10. default value for struct member in C - Stack Overflow

    Dec 5, 2012 · Is it possible to set default values for some struct member? I tried the following but, it'd cause syntax error: typedef struct { int flag = 3; } MyStruct; Errors: $ gcc -o testIt test.c test....