hello I am new to C++. I understand pointers and references a little and I must be missing something in conf.cpp. Would you help by pointing out my errors for my pointers coding errors related to my problem? Main reason I am asking is because I get a segment fault where 'servername' is.
Re: Variable pointers or References for .conf parser?
Most certainly! My program is going to be an IRC Services server. At this stage of engineering I am as you see working on the configurations file routings. getting the pram variable data into the an variable that will be accessible through out the program is my problem. As for the main.cpp it is only calling the read_conf(); in conf.cpp.
Last edited by mknight; Nov 26th, 2006 at 7:29 am.
Most certainly! My program is going to be an IRC Services server. At this stage of engineering I am as you see working on the configurations file routings. getting the pram variable data into the an variable that will be accessible through out the program. As for the main.cpp it is only calling the read_conf(); in conf.cpp.
Ok that was a rather generic explantion. I was looking for something more detailed. Such as:
Finally once we have identified which line contains which variable we just need to extract the information between the quotes. And then store that into the corresponding variable.
Is this right so far?
Last edited by iamthwee; Nov 26th, 2006 at 7:51 am.
Finally once we have identified which line contains which variable we just need to extract the information between the quotes. And then store that into the corresponding variable.
Is this right so far?
I am so sorry again! I didn't remove the unused variables like the subval, dirint.
you got the idea of what I am trying todo just that the sub is the directive word and pram is the value. As shown
To explain the code better the 'read_conf()' loads a line into the line test to see if it should ingore the comment lines then send it to parse to evaluate the line further. if the program will also ingore tabs. As for spaces it uses an logic controls to allow or disallow spaces smspace is set to 1 so it will ingore spaces by default. As for 'cur' variable which stands for cursor to which variable it would be either 'sub' or 'pram' variables.
After that it would compare the first word to the corsponding if control to find out what variable is going to host the 'pram' values. this as I said is the part I am having problems with.
Last edited by mknight; Nov 26th, 2006 at 8:46 am. Reason: learnning the way this site works I goofed again :)
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.