Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Read different datatypes from file. (http://www.go4expert.com/forums/read-datatypes-file-t29404/)

tapender_iitp 6Jan2013 19:15

Read different datatypes from file.
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 7Jan2013 22:44

Re: Read different datatypes from file.
A segfault means your program is writing to some memory it shouldn't be writing to (typically a NULL pointer).

All times are GMT +5.5. The time now is 13:32.