Aaron Swan Aaron Swan 9 9 silver badges 17 17 bronze badges. Shan Shan 4 4 silver badges 12 12 bronze badges. Hari Hari 3 3 gold badges 13 13 silver badges 22 22 bronze badges. Is the input in the form shown in the comments at the top of my code snippet? File file.
They can be different from the actual variable names. A quick-start example taken from the above repository. Begin ; it! Hanzhe Teng Hanzhe Teng 25 1 1 silver badge 5 5 bronze badges.
The following is the input file config. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Also, this works with any container constructor or iterator algorithms.
Far better, in my opinion. David David Peter Wood Peter Wood Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Today's Posts. Quick Links. Search Forums. Show Threads. Show Posts. Read arguments from a config file in C. Top Forums Programming Read arguments from a config file in C.
Registered User. Join Date: Aug Hello everybody, I'm coding a program in C and i'm getting troubles with this. I need to read a config file and store the arguments into individual variables, let's say the config file looks like the following: Code :. View Public Profile for semash!
Tom Tom 1 1 gold badge 2 2 silver badges 6 6 bronze badges. Add a comment. Active Oldest Votes. The file that you are opening should be closed with fclose fp. Improve this answer. But how would I parse my file's lines for the values I need without using sscanf?
I'll certainly use your whitespace-stripping routine too, thanks. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog.
0コメント