storing struct ??!!「》

This is a discussion on storing struct ??!!「》 within the C Programming forums, part of the General Programming Boards category; hi, can someone help me ! i want to store ten sets of this structure with point x and y ...

  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, 03:16 AM
  2. Problem storing in char pointer
    By Termina in forum C Programming
    Replies: 2
    Last Post: 05-02-2008, 08: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, 09:54 PM
  5. Search Engine - Binary Search Tree
    By Gecko2099 in forum C Programming
    Replies: 9
    Last Post: 04-17-2005, 03:56 PM

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