Thread: square, rectangle, an triangle

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    1

    Exclamation square, rectangle, an triangle

    I would like someone , if they have the time and patience to help me out with a a very basic and simple program. I need help constructing a square, a rectangle and a triangle of any size. If someone could possibly teach me, I would greatly appreciate it. Thank you.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Code:
    typedef struct
    {
       int X;
       int Y;
    }POSITION;
    
    typedef struct
    {
       int Width;
       int Height;
    }DIMENSION;
    
    typedef struct
    {
       POSITION Position;
       int WidthAndHeight;
    }SQUARE;
    
    typedef struct
    {
       POSITION Position;
       DIMENSION Dimension;
    }RECTANGLE;
    
    typedef struct
    {
       POSITION Corner1;
       POSITION Corner2;
       POSITION Corner3;
    }TRIANGLE;
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Heres one way.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Forced moves trouble!!
    By Zishaan in forum Game Programming
    Replies: 0
    Last Post: 03-27-2007, 06:57 PM
  2. Help with my draughts game
    By Zishaan in forum C++ Programming
    Replies: 9
    Last Post: 03-24-2007, 07:33 AM
  3. Help With pointers in classes.
    By indigo0086 in forum C++ Programming
    Replies: 12
    Last Post: 10-10-2002, 02:03 PM
  4. internal heap limit
    By Unregistered in forum C Programming
    Replies: 8
    Last Post: 02-05-2002, 09:33 AM