|
From: Daniel G. <sp...@ho...> - 2002-03-23 20:43:16
|
<html><div style='background-color:'><DIV>Hi, just been going over my course notes and I've come across the Struct tag. An example is below.</DIV>
<DIV>Looking at it, how is this different to a class? And why use it?</DIV>
<DIV> </DIV>
<DIV>Also, what's the difference between an array, and a vector, which I understand is its replacement but know little about them.</DIV>
<DIV> </DIV>
<DIV><FONT color=#ff0000>
<P>// A demonstration of the Employee structure</P>
<P>#include <iostream.h></P></FONT><FONT color=#800080>
<P>struct</FONT><FONT color=#ff0000> </FONT><FONT color=#008000>Employee</FONT><FONT color=#ff0000> // declaration of a structure type</P>
<P>{</P>
<P>int EmpID;</P>
<P>char EmpName[30];</P>
<P>char EmpAddr[40];</P>
<P>float Salary;</P>
<P>void GetData();</P>
<P>}EmpOne</FONT><FONT color=#0000ff>;</FONT><FONT color=#ff0000> // Optional declaration of a structure variable</P>
<P>void main()</P>
<P>{</P>
<P>}</P></FONT></DIV></div><br clear=all><hr>Join the worlds largest e-mail service with MSN Hotmail. <a href='http://g.msn.com/1HM305301/15'>Click Here</a><br></html>
|