Thread: storing struct ??!!「》

  1. #1
    Unregistered
    Guest

    storing struct ??!!「》

    hi, can someone help me !
    i want to store ten sets of this structure with point x and y in a array.

    can i do something like points[1].x = 1; points[1].y= 2
    to store the values ?

    typedef struct {
    float x,y;
    } Point;

    Point points[10];

  2. #2
    Registered User Engineer's Avatar
    Join Date
    Oct 2001
    Posts
    125
    Everything you are doing in your code IS valid and should work.

    Cheers.
    1 rule of the Samurai Code: if you have nothing to say, don't say anything at all!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting from C to C++
    By Taka in forum C++ Programming
    Replies: 5
    Last Post: 04-08-2009, 02:16 AM
  2. Problem storing in char pointer
    By Termina in forum C Programming
    Replies: 2
    Last Post: 05-02-2008, 07:22 PM
  3. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  4. newbie needs help with code
    By compudude86 in forum C Programming
    Replies: 6
    Last Post: 07-23-2006, 08:54 PM
  5. Search Engine - Binary Search Tree
    By Gecko2099 in forum C Programming
    Replies: 9
    Last Post: 04-17-2005, 02:56 PM