Read different datatypes from file.

tapender_iitp's Avatar
Newbie Member
I want to read a data of type int, character string and float from a file and store it in an array of structure.I read the data from the file and stored it in an character array. now i m using sscanf to store extract the different datatypes from this character array to store in the array of structure with three different elements and datatypes. but it is showing me a segmentation fault. kindly suggest me some remedy or else suggest a better method.
xpi0t0s's Avatar, Join Date: Aug 2004
A segfault means your program is writing to some memory it shouldn't be writing to (typically a NULL pointer).