I’m wanting to load a known number of numbers into an array in C from a text file (.txt). The format would be:
“0,1,2,5,4”
I’m kinda new to C, can anyone recommend a way to load in the text file?
Cheers
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It can be done easily with
fscanf:@pmg: Sure, why not. I just though if it is a hw, then it is a bad thing to give a complete solution 🙂