SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been complaining about lib problems. It turns out that the libs are basically ok, but the documentation is incomplete. I was trying to get fscanf and sscanf to work, the man page only gave me the desc and target but did not give any information about how arguments are used. This extends into the problem of isdigit. Since isdigit is a wrapper around a wrapper around a wrapper It is not possible to debug the call.
related to this is the definition of an int. Since I have a **char I should be able to index the characters of the token. There is no configuration that I can determine that will not cause a segerror in the calll. I discovered I cannot refer to **token as *token[0]. It does not work at all and generates a segerror. I am annoyed that the compiler confuses int16 with char8. I dont know how to tweak this to work. I need to write my own isdigit. and I need to create a substring function. there is no substring definition in the libraries I have. It is not in the man page and it is not in the info.
For your segerror, try to post the relevant part of your code that generate
the error, maybe at a more appropriate forum, though like the programming
section of this site
The problem seems to be an inconsistency in GCC. Some times it works and some times it fails and there is not enought information to determine if I am at fault ro the compliler is goofing off. I could not find any fault with the code to select indexing. It kept failing with segerror. i wrote a different peice of code and it worked. I cant figure out what is happening.
The code is now working. GCC passes in a char and in the routine thinks that ch is an int. sigh. I stopped trying to print it and it started working. So a char on the stack is not a char but an int. It iwill not print with %s GCC changed the data type. It does not say it does this, but cllearly this is what GCC did. Debuging is hard when I dont expect tokens to be constant.
It is the incompleteness of C that causes me to lose it. The documentation for strstr I have is that you pass in a char and it returns a pointer to that location. this is not a substring function. May be your man pages are right , and mine is just wroing. a substring should return the substring as a separate string.
If I complain and jump up and down and sleep on it. I will think of some fiix and it works. On to the next fuzzy problem.
] Thank you for the suggestion.
josephus
I don't know what program you are trying to write, but you might consider using GLib 2.x to manipulate data structures such as arrays, simple or double linked lists, strings... GLib 2.x has a up-to-date, complete documentation, it is quite portable and it provides a set of commonly used utility functions which can save a lot of time. I use it and I'm really satisfied.
You also might want to consider notifying a moderator and having this thread moved to the programming section of LQ. I imagine you'd have more luck there, even though many Slackers are indeed programmers
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.