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

    34 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 …

  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. What's the syntactically proper way to declare a C struct?

    Jan 15, 2011 · 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 I use a struct rather than a class in C#?

    When should you use struct and not class in C#? My conceptual model is that structs are used in times when the item is merely a collection of value types. A way to logically hold them all …

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

  6. Can I compare 2 structures in C++? - Stack Overflow

    Aug 10, 2016 · I have simply declared a structure like this - struct data{ int x,y; }; Now I have declared 2 variables a & b of data type. I've assigned appropriate values to them. Now, I …

  7. What's the difference between struct and class in .NET?

    Dec 16, 2017 · In .NET, there are two categories of types, reference types and value types. Structs are value types and classes are reference types. The general difference is that a …

  8. c - Passing struct to function - Stack Overflow

    Apr 29, 2012 · A bit late to ask, but why typedef the struct to the same name (but with a capital)? I'm also wondering why you need to create a pointer to the struct (*cptr), then use that to pass …

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

  10. Struct inheritance in C++ - Stack Overflow

    Dec 15, 2017 · 6 Yes, c++ struct is very similar to c++ class, except the fact that everything is publicly inherited, ( single / multilevel / hierarchical inheritance, but not hybrid and multiple …

Refresh