|
From: Ioannis V. <no...@ho...> - 2002-03-23 22:05:45
|
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Daniel
Glenfield
Sent: Saturday, March 23, 2002 10:43 PM
To: dev...@li...
Subject: [Dev-C++] Struct tag
Hi, just been going over my course notes and I've come across the Struct
tag. An example is below.
Looking at it, how is this different to a class? And why use it?
In C++ a struct is a class with its members public by default.
Also, what's the difference between an array, and a vector, which I
understand is its replacement but know little about them.
A vector is a high level container written with templates with purpose
to provide the same functionality and efficiency while at the same time
providing safety and comfort.
// A demonstration of the Employee structure
#include <iostream.h>
#include <iostream>
struct Employee // declaration of a structure type
{
int EmpID;
char EmpName[30];
char EmpAddr[40];
float Salary;
void GetData();
}EmpOne; // Optional declaration of a structure variable
void main()
int main()
{
}
Ioannis
* Ioannis Vranos
* Programming pages: <http://www.noicys.d2g.com/>
http://www.noicys.d2g.com
* Alternative URL: <http://run.to/noicys> http://run.to/noicys
|