Thread: how to read data of any type into array

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    45

    how to read data of any type into array

    i want to read data of any type into an array....Is it possible..??
    if possible how to do it..??

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    I haven't done it but you could use void pointers to point to any allocated space. That should work for any basic type, at least.

    Usually, it's either text or numbers that you're dealing with, so you start with that data type, and change it to the other, if needed. This makes using C's built in functions, quite easy. You can't use them with void data, since the size of the data, is unknown. That's my opinion, I haven't tried it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-31-2011, 04:50 PM
  2. Why Array is derived data type ?
    By forumuser in forum C Programming
    Replies: 2
    Last Post: 10-19-2007, 06:01 AM
  3. Read size of data array when reading .txt data
    By Taquito in forum C Programming
    Replies: 13
    Last Post: 04-29-2007, 01:52 AM
  4. Array own data type?
    By TriKri in forum C Programming
    Replies: 2
    Last Post: 07-16-2006, 01:03 PM
  5. change array data type
    By panfilero in forum C Programming
    Replies: 2
    Last Post: 10-16-2005, 04:52 AM