use of float type array in structures

This is a discussion on use of float type array in structures within the A Brief History of Cprogramming.com forums, part of the Community Boards category; i have a problem related to use of float array in strucures as we enter the structure using scanf() function ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    2

    use of float type array in structures

    i have a problem related to use of float array in strucures as we enter the structure using scanf() function it take only one float array member and skip all of the rest kindly help
    i have boorland compliler of c++
    under win 98
    vp singh

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    A loop, preferably a for-loop:
    Code:
    for(int i=0; i<NrOfElementsInArray; i++)
    {
       scanf("%f", &MyArray[i]); //I hope this is the right syntax... :rolleyes:
    }
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Little Array Difficulty
    By G4B3 in forum C Programming
    Replies: 16
    Last Post: 03-19-2008, 12:59 AM
  2. help me
    By warthog89 in forum C Programming
    Replies: 11
    Last Post: 09-30-2006, 08:17 AM
  3. Type and nontype parameters w/overloading
    By Mr_LJ in forum C++ Programming
    Replies: 3
    Last Post: 01-02-2004, 12:01 AM
  4. Erros in Utility Header File
    By silk.odyssey in forum C++ Programming
    Replies: 4
    Last Post: 12-22-2003, 05:17 AM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM

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