473,769 Members | 7,810 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is the difference between "struct" and "class"?

anybody who tell me: what is the difference between "struct" and
"class"?
:-)

Oct 26 '05 #1
6 2403
struct members are public by default

Oct 26 '05 #2
except the default access popedom, there is only felling left

Oct 26 '05 #3
"XiongBin" <hu*****@gmail. com> writes:
anybody who tell me: what is the difference between "struct" and
"class"?
:-)

It's a frequency asked question
http://www.parashift.com/c++-faq-lit...s.html#faq-7.8

Oct 26 '05 #4
"XiongBin" <hu*****@gmail. com> schrieb im Newsbeitrag
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
anybody who tell me: what is the difference between "struct" and
"class"?
:-)


Except the default access public/private, the default inheritance is
different, too. For structs the default inheritance is public, for classes
it is private. IIRC this is not written in the FAQ.

Greetings Chris
Oct 26 '05 #5
XiongBin wrote:
anybody who tell me: what is the difference between "struct" and
"class"?
:-)


Another tiny issue is that you can only use the keyword class in a
template template parameter, and not struct. But then we're speaking of
keyword, and not an actual entity.

--
Regards,

Ferdi Smit (M.Sc.)
Email: Fe********@cwi. nl
Room: C0.07 Phone: 4229
INS3 Visualization and 3D Interfaces
CWI Amsterdam, The Netherlands
Oct 26 '05 #6
ti****@kingsoft .net wrote:
except the default access popedom, there is only felling left


What?

Brian

--
Please quote enough of the previous message for context. To do so from
Google, click "show options" and use the Reply shown in the expanded
header.
Oct 26 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2517
by: dpr | last post by:
I have come accross a piece of C++ code with the construct: MyClass *c = new class MyClass(); Is there a difference between this and: MyClass *c = new MyClass(); ?
0
1239
by: Gianni Mariani | last post by:
It started out as an ugly hack and it turned out to be very easy to do but I'm concerned about wether I'm not seeing somthing so I'm asking the wise ladies and gents of clc++ as to wether they turn to stone. The problem goes like this. I have a class that uses an intrusive reference count to manage the it's life-time. This class has multiple interfaces e.g. (using Austria C++ type smart pointers)...
11
9427
by: Daniele Benegiamo | last post by:
Is the following program standard-compliant? I've compiled it with some compilers and no errors or warnings are produced, but this is not a demonstration. The "incriminated" part is the declaration: extern "C" struct X; that is then defined as:
4
4410
by: Daniel Mark | last post by:
Hello all: I have found a useful module in IPython, named 'from IPython.ipstruct import Struct". So I can use it as follows: #################################### from IPython.ipstruct import Struct
3
4357
by: angshuman.agarwal | last post by:
Structure in C DLL ---------------------------- typedef struct IrData { unsigned short uiFormat; unsigned short uiLength; unsigned char* pchData; } tagIrData; Function in C DLL
8
28469
by: Mohammad Omer Nasir | last post by:
Hi, i made a structure in header file "commonstructs.h" is: typedef struct A { int i; A( ) {
15
2681
by: arnuld | last post by:
-------- PROGRAMME ----------- /* Stroustrup, 5.6 Structures STATEMENT: this programmes *tries* to do do this in 3 parts: 1.) it creates a "struct", named "jd", of type "address". 2. it then adds values to "jd" 3.) in the end it prints values of "jd".
14
2520
by: =?GB2312?B?zPC5zw==?= | last post by:
Howdy, I wonder why below does not work. a = object() a.b = 1 # dynamic bind attribute failed... To make it correct, we have to create a new class: class MyClass(object): pass a = MyClass() a.b = 1 # OK
6
2885
by: Luna Moon | last post by:
Here is a quote from the book: C++ Annotations, I don't understand these sentences, could anybody help me? thanks! As a side effect to this implementation it must be stressed that it is not anymore correct to declare iostream objects using standard forward declarations, like: class ostream; // now erroneous
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.