'Is there any other way to store data in c except in a text file or csv file?

~Lately , I've been struggling a lot w/ file handling in c ,is there any other way to store data in c?

I'm working on a project that analyze company's stocks for you, so in that ,

~firstly I've to store password , name , no. of stocks ,company name , no of shares of each company , price of each share , total .

~Secondly , if the user wants to see his/her portfolio ,he/she has to insert the password and I'll compare that password w/ previously inserted passwords of users and then show his/her portfolio.

Thirdly , if the user want to delete any specific company's stock .

And currently , i'm on the second part where I've to display portfolio . I'm using fscanf to read the data , but sometimes it didn't stop at the end of file and also I don't how to correctly read lines with it.

c


Solution 1:[1]

Using C, you can store your data in binary or text formats. CSV, JSON, XML, atom, et al are all text files with some syntax and semantics, that is all. C has all abilities to store in whichever format you desire. Read about the various IO functions, like fscanf, fread, etc.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anand Sowmithiran