Solved

Classes vs. Structs

Posted on 1998-06-06
4
199 Views
Last Modified: 2010-05-19
For a small collection, would it be better to use a class or a struct?  Which is faster?

Also, what is the best remedy to fight the ongoing carpal tunnel syndrome?

Please help!

0
Comment
Question by:ichor
  • 2
  • 2
4 Comments
 

Accepted Solution

by:
VisualLR earned 50 total points
ID: 1165331
For the first question, I'd have to say that a struct and a class are not the same, they are similar but they dont work the same.

See, a class is more advanced, and you can do a plethora of different things with it. You can derive other classes and all sorts of stuff... for more stuff on classes read "Beggining Visual C++ 4" from Wrox publishing.

And to fight carpal tunnel syndrome, I'd have to say it's "STOP CRYING YOU LIAR, ITS ALL IN YER HEAD!"
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165332
I'm afraid VissualLR is incorrect on both counts!

structs and classes are 100
0
 

Expert Comment

by:VisualLR
ID: 1165333
no one asked you nietod... and no one was looking for a serious answer either. But if you're so sure... lemme see you derive a structure or inherit one...
0
 
LVL 22

Expert Comment

by:nietod
ID: 1165334
Woa!  I had a complete answer explaining the difference. and also recomending laproscopic surgery That's the first two lines!

Anyway what I had said was

Structurers and Classes 100 percent the same except for one minor difference.  Stuctures default to public members and public inheritance  and classes default to private members and private inheritence.  But these are defaults only.  They can be overridden with the public and private declarations.  Thus

struct ClasslikeStruct
{
private:
   int x;
};

Is just like

class ClassLikeClass
{
   int x;
};

As to the carpal tunnel. There is one answer.  Surgery.  And there is no reason to wait.  If you are going to have done, get it done earlier rather than later.  The sooner it is done the sooner you get relief.  However, make sure you get it done laproscopically.  The regular technique is butchery.  It involves an incission that runs almost from the wrist to the base of the fingers.  That is a huge incission and it takes many weaks to heal and makes it almost impossible to use your hand for about 6 weeks.  The laproscopic technique makes a small incission, less than an inch across the wrist.  This heals in about 2 weeks and you will be back to using your hand some in about 3 or 4 days and back to normal in about 2 weeks.  This also leaves no vissible scar.  

If your insurance will not pay for the laproscopic technique, whisc is about an extra $3,000 per hand, contact a lawyer.  You will be out of work considerably longer with the other technique and that is grounds for a suit, they will cave in quickly.

VissualRL
  No one did ask me.  But they asked you and you gave an incorrect answer.  enough said.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
TTimer no longer functioning 7 91
Dynamically allocate memory 9 58
Dialogbox API leak? 18 96
VS2015 Redefinition errors 4 52
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question