Entity

This is a discussion on Entity within the C++ Programming forums, part of the General Programming Boards category; Consider an entity as Customer. Let its attributes be Name, Contact address and Phone no. A function is responsible for ...

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    36

    Entity

    Consider an entity as Customer. Let its attributes be Name, Contact address and Phone no. A function is responsible for setting and another for printing the values for an instance of this entity.

    How to implement this this entity with its attributes and functions as a struct in C++ ?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    Same way you do it as a class. There's no difference between structs and classes in C++ other than default access. So if you want something private in your struct make sure you say so.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How does this Game Maker-like c program look
    By hahaguy in forum Game Programming
    Replies: 0
    Last Post: 04-23-2009, 06:32 AM
  2. entity framework and inserting rows
    By Elkvis in forum C# Programming
    Replies: 0
    Last Post: 04-01-2009, 07:36 AM
  3. Unit Actions
    By DavidP in forum Game Programming
    Replies: 20
    Last Post: 05-28-2004, 09:18 PM
  4. Fanfiction is an evil entity that must be destroyed...
    By Scourfish in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 02-15-2002, 07:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21